Deploying a copy of existing database with a different name on the same server

I am a developer(an inexperienced one) trying to understand what is the best way to deploy a brand new database with
the exact same schema as an existing DB on the same server, but with a different name. I want to preserve the data in all reference tables which I can do by having the relevant post-deployment scripts run after the deployment. 
What I can't understand is how the project should be set up to deploy database Customer_2 if database Customer_1 exists on
this server - the Visual Studio project contains DB Customer and I need to find a way to be able to deploy Customer_N (but without creating N identical DB's in the project). I checked a ton of articles and blogs, and feel dumb asking this question but haven't
been able to understand it yet. Any help would be appreciated.

Hello,
Maybe the TargetDatabase and the DeployToDatabase properties can help you.
http://www.asp.net/web-forms/tutorials/deployment/web-deployment-in-the-enterprise/deploying-database-projects
You can deploy multiples databases from one project if you want, as explained on the following
post:
http://stackoverflow.com/questions/1544966/gdr-deploying-multiple-database-targets-with-one-project
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com

Similar Messages

  • How to create a new database after copying an existing database with a new name

    hi
    i have an existing database and want to copy with a new name in sql server 2005 how do it is possible 
    spose
    i have a db name attached in sql server StoreManagementDB now i want to copy this database with all the transactions as StoreManagementDB_1.
    thanks

    Use a two steps to use a backup file to restore a database with a new name.
    ----You need to have a full backup of your database:
    --Step 1:
    RESTORE FILELISTONLY
    FROM DISK = 'C:\bk\TEST.BAK'
    --Find out the LogicalName of data file and log file
    -- in this case: the data file: TEST and the log file LogicalName: TEST_log
    --Both names will be used in the MOVE command
    --Step 2:
    -- Restore the files for test1.
    RESTORE DATABASE test1
    FROM DISK = 'C:\bk\TEST.BAK'
    WITH RECOVERY,
    MOVE 'TEST' TO 'C:\bk\test1_Data.mdf',
    MOVE 'TEST_log' TO 'C:\bk\test1_Log.ldf'
    GO

  • Unable to copy database with different name in the same instance

    I had a huge database and wanted to try some change optimization changes.
    So wanted to make a copy of the database along with data in the same instance.
    I have tried copy database wizard several times but always see the error as in attachment.
    Can someone let me know how to troubleshoot further?
    If this is not the correct way please suggest how do i copy a database with different name in the same instance along with data.

    Hi Nandu,
    From the screenshot, the error 1813 happens when corrupt database log is attempted to attach to the SQL Server. To work around this issue, please preform the following steps, for more details, please review this
    blog.
    1. Create a new database with same name which you want to recover. Make sure that the MDF file and LDF file have same name with previous database data and log file.
    2. Stop SQL Server. Move original MDF file from old location to new location by replacing just created MDF file. Delete the LDF file of new location just created.
    3. Start SQL Server. At this point, the database is in suspect status.
    4. Make sure that system tables of Master database allows to update the values. Please note that you will be performing this in query window.
    Use Master
    go
    sp_configure 'allow updates',1
    reconfigure with override
    go
    5. Change database mode to emergency mode.
    SELECT *
    FROM sysdatabases
    WHERE name = 'DatabaseName'
    BEGIN
    UPDATE sysdatabases
    SET status = 32768
    WHERE name = ' DatabaseName '
    COMMIT TRAN
    6. Restart SQL Server. Then execute the following DBCC command in query window to create new log file.
    DBCC TRACEON (3604)
    DBCC REBUILD_LOG(databasename,'c:\yourdatabasename_log.ldf')
    GO
    7. Reset the database status using following command.
    sp_RESETSTATUS yourdatabasename
    GO
    8. Turn off the update to system tables of Master database running following script.
    USE MASTER
    GO
    sp_CONFIGURE 'allow updates',0
    RECONFIGURE WITH OVERRIDE
    GO
    9. Reset the database status to previous status.
    BEGIN
    UPDATE sysdatabases
    SET status = (value retrieved in first query of step 5)
    WHERE name = 'DatabaseName‘
    COMMIT TRAN
    GO
    Make sure that you have done all the steps in order and restarted SQL Server where it is mentioned. Also run SQL Server Management Studio as administrator.(Right click-> Run as Administrator)
    Thanks,
    Lydia Zhang

  • Can 2 different users with 2 different Iphones use the same itunes to backup each phone separately? if not how can I have a backup for 2 different iphones on the same laptop?

    can 2 different users with 2 different Iphones use the same itune program to backup each phone separately? if not how can I have a backup for 2 different iphones on the same laptop?

    Here is your answer:
    http://support.apple.com/kb/HT1495

  • How to I share Itune library, and movies with a different user on the same computer?

    How do I share Itunes and movies with a different user on the same computer?

    https://discussions.apple.com/community/itunes

  • How do I sync two ipods with two different IDs on the same computer?

    How do I sync two ipods with two different IDs on the same computer?

    Simply connect them.  One computer with one iTunes can manage multiple devices.  They're tracked by S/N but you might wish to assign them unique names so that you can track them yourself.
    The only minor issue is app updating and purchases while on the computer.  It's necessary to log out and back in to the "correct" ID.  Much easier to do these things from the iPods.

  • Collecting data from advantech-usb4704 with two different apps at the same time

    I wonder if I can access to Advantech-4704 with two different applications at the same time?
    I use this block in my vis.
    I have enough ports, but inputs are needed in completely different applications. Do I have to close one of them or can they run simultaneously?
    Thankyou!

    Dear gtu,
    as nathand said, usually it is not supported to access the same physical resource simultaneously from multiple programs. In case of DAQmx for instance, you will get an error message which says that the resource is already reserved. I suppose the same would happen with your driver, however it might be worth a try.
    One workaround could be however if you revise your applications and merge the codes if it is possible so that no concurent resource allocation takes place.
    Best Regards,
    Adam Cseh
    Applications/Systems Engineer
    National Instruments

  • Is it possible to face time with 3 different people at the same time?

    Is it possible to face time with 3 different people at the same time?

    Check out GoToMeeting http://tinyurl.com/k6q84kw
     Cheers, Tom

  • Multiple oracle database instances with different characterset on  the same server

    Hello,
    Is it possible to have 2 database instances running with different charactersets,one with AL32UTF8 and the other with WE8MSWIN1252.?
    Are there any setup requirements to be performed prior to setting up the database instances?
    The 3rd party utility that we want to use does not support AL32UTF8 and insists on using a database with character set WE8MSWIN1252.
    Kindly help.
    Thanks,
    Ram.

    Hello Zhe,
    I guess I posted my question in a wrong forum.  I tried my best to find a suitable forum and thought this was the best and closest I found.  Apparently not.  Can you please let me know the right forum for my question?
    The below is the breif of what we are currently facing:
    We are in the process of finalizing plans to install Automic for our Retail applications to schedule jobs.  In the process came to know that Automic does not support AL32UTF8.
    Right now we have RMS and UC4 (now called Automic) run on the database server as UC4 supports AL32UTF8 and schema for UC4 is inside the RMS database.
    Going forward it is recommended to have a separate database instance on the same server as that of RMS database and with a different characterset which is WE8MSWIN1252.
    Please let me know what forum to post in, I will repost the question.
    Thanks,
    Ram.

  • Is it possible to have 2 instances with the same name but different edition in the same server?

    Hi everybody!
    I have in a little trouble ....
    *** Scenario.
    Oracle Enterprise Edition 11gr2 over Oracle Solaris 11
    3 instances: PROD, QA, DEV
    1 ASM instance
    Listener ports: 1520, 1530 & 1540
               Those are production system
    *** The problem:
    Customer can't pay Oracle EE, they want to change to Oracle Std One
    Limitations:
    I cant have a similar system to test.
    *** My idea:
    Install Oracle Std One, in the same path:
    /u01/app/oracle/product/11.2.0/db          <-- EE
    /u01/app/oracle/product/11.2.0/db_one   <-- Std Ed One
    ASM:
    /u01/app/11.2.0/grid          <-- EE                    +ASM
    /u01/app/11.2.0/grid_one   <-- Std Ed One        +ASM1
    Create databases:
    Asign similar disks to +ASM1
    Create DGs on +ASM1
    Create databases: PROD, QA, DEV for Std Ed one
    - is it posible that they have same instance name?
    - if not, i suppose create as: PROD1, QA1, DEV1
    Configure Listener port : 1521, 1531 & 1541
    Migration technique:
    Create Tablespaces, schemas
    Lock users in EE
    down listener: 1520, 1530 & 1540
    Import data of final users in a window maintanance
    configure and up listener: 1521, 1531 & 1541
    Customer should test access and apps in new
    Please tell me if my Idea is reallistic, all comments are going to be very apreciated.

    sol.beach
    I suppose end customer use a port per database in order to separate in a logical way the access to the databases,
    i mean PROD, QA & DEV has the same users.
    Hemant K Chitale
    1. I've seen physical servers with 3 ASM instances: +ASM1, +ASM2, +ASM3
       on Solaris & Oracle 10g, I suppose is posible on 11g
    2. The sever has occupied 2  sockets (2 physical CPU), so I can use Oracle Standard Ed One.
    JohnWatson2
    Thanks for your comments.
    WadhahDaouehi
    1. - You cannot run two ASM instance simultaneously on one Server, but you can run many Oracle database simultaneously
          on the same server which they use the ASM as storage type.
      As a mentioned to  Hemant K Chitale, I've seen a system with several instances running
      About
         "you can run many Oracle database simultaneously on the same server which they use the ASM as storage type."
      I'm not sure if i can use the same ASM which is part of a current Enterprise Ed over the new installation with Oracle Std Ed One.
    2. - Why you want the same instance name?
    If it is about the service name, which has by default the same instance name, just you can create a different instance name
    and create the service name with the name that you wish.
    SQL> alter system set service_names='instance_name';
    Is a similar name, not the same
    PROD, QA & DEV
    PROD1, QA1 & DEV1
    I consider add "1" at the end to refer "Oracle Standar Ed One"
    But I agree with you, i can customize throught service_name.
    Regards,
    Abraham Mtz.

  • How Can I do it with to different ipod on the same computer ?

    I have and ipod(1GB) and my daughter has another ipod(4GB), how can we work with the same computer and itune for 2 different ipods ?
    iPod(1GB) and a second iPod(4GB)   Windows XP   2 different iPods on the same computer

    this document might be of some help with that:
    How to use multiple iPods with one computer
    if you decide on a multiple-user-account strategy, this document might also be useful:
    iTunes: How to share music between different accounts on a single computer

  • How to keep same database with two different names in SharePoint 2013 for two different applications

    Hi All,
    I have very strange situation.
    I had SP2010 production database(wss_content_contoso) migrated to SP13 few months back to migrate one site collection only while I have 15 site collections stored in this database and created a site contoso.com
    Now, I want to migrate same(wss_content_contoso) SP2010 database to SP13 and want to create contoso2.com.
    I changed database name from wss_content_contoso to wss_content_contoso2 and assigned newID during mount process.
    After this exercise, I don't see any site for contoso2.com and issue seems to be the same database. 
    My question is!!!!
    How I can keep both databases(actually same database with different names) and run both application simultaneously?
    Any help appreciated!!
    Thank you,
    AM
    AM Senior SharePoint Consultant

    You need to run Backup-SPSite/Restore-SPSite on each Site Collection you want to 'duplicate'. You cannot restore the same Content Database to the same farm as the Site Collections have the same GUID, which is stored globally for the farm.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Sharing Itunes with a different user on the same computer...

    Can I allow a different logged in user to gain access to my music library on the same computer? If so...How the heck do you do it? I tried something once and thought I lost my whole library!
    Thanks.

    The following document may be of some assistance with that:
    iTunes: How to share music between different accounts on a single computer

  • How do you do home share with in different accounts on the same computer?

    How do you homeshare within different log in accounts (and itunes accounts) within one computer?

    Simply connect them.  One computer with one iTunes can manage multiple devices.  They're tracked by S/N but you might wish to assign them unique names so that you can track them yourself.
    The only minor issue is app updating and purchases while on the computer.  It's necessary to log out and back in to the "correct" ID.  Much easier to do these things from the iPods.

  • Selecting two different Names using the same table with same field

    Hello,
    I am trying to display several fields from different tables. Here are some of the fields that I need: The instructor needs to go after the social.
    WESL | ENGR-1101-SW1 | Hinojosa | Ashley | Social | Instructor |
    I am using a table where they have the social and I need to get both the student and the instructor. How do I select the instructor when the instructor's id is on a different table. example
    CLASS PERSON CLASS_ASSIGN
    student_id student_id: name facutly_id
    Here is the code that I have so far and it works.
    rem ----------------
    rem Filename: cer.sql
    rem Purpose: to get data from banner and put into flat file
    rem Date: August 17, 2006 4:51 P.M.
    rem Author: Robert Hernandez
    rem ---------------
    rem Notes: Need to add the Instructor - having problems
    rem using the same spriden_id.
    rem Also need to have admissions enter the grad date for
    rem several students: Procedure is working as is.
    declare
    l_output utl_file.file_type;
    grad_month varchar2(2);
    buffer varchar2(1000);
    cursor cursor1 is
    select ssrmeet_bldg_code,
    ssbsect_subj_code,
    ssbsect_crse_numb,
    ssbsect_seq_numb,
    spriden_last_name,
    spriden_first_name,
    spriden_id,
    scbcrse_title,
    ssbsect_term_code,
    sfrstcr_grde_code,
    sorhsch_graduation_date,
    decode(substr(sorhsch_graduation_date,4,3),'JAN','01',
    'FEB','02',
    'MAR','03',
    'APR','04',
    'MAY','05',
    'JUN','06',
    'JUL','07',
    'AUG','08',
    'SEP','09',
    'OCT','10',
    'NOV','11',
    'DEC','12') as grad_month,
    sorhsch_sbgi_code
    from ssbsect,ssrmeet,sfrstcr,spriden,scbcrse,sorhsch
    where rownum < 200
    and ssbsect_seq_numb like 'S%'
    and (ssrmeet_term_code = ssbsect_term_code
    and ssrmeet_crn = ssbsect_crn)
    and (ssbsect_crn = sfrstcr_crn
    and sfrstcr_pidm = spriden_pidm
    and length(spriden_id) = 9
    and substr(spriden_id,1,1) <> 'A')
    and (ssbsect_crse_numb = scbcrse_crse_numb
    and ssbsect_subj_code = scbcrse_subj_code)
    and spriden_pidm = sorhsch_pidm
    and sorhsch_graduation_date is null
    order by ssbsect_crse_numb;
    begin
    l_output := utl_file.fopen('CER','rbfpce.txt','W');
    for cur1_rec in cursor1 loop
    buffer:= cur1_rec.ssrmeet_bldg_code||'|'||
    cur1_rec.ssbsect_subj_code||'-'||
    cur1_rec.ssbsect_crse_numb||'-'||
    cur1_rec.ssbsect_seq_numb||'|'||
    cur1_rec.spriden_last_name||'|'||
    cur1_rec.spriden_first_name||'|'||
    substr(cur1_rec.spriden_id,1,3)||'-'||
    substr(cur1_rec.spriden_id,4,2)||'-'||
    substr(cur1_rec.spriden_id,6,4)||'|'||
    cur1_rec.scbcrse_title||'|'||
    cur1_rec.ssbsect_term_code||'|'||
    cur1_rec.sfrstcr_grde_code||'|'||
    '20'||SUBSTR(cur1_rec.sorhsch_graduation_date,8,2)||
    cur1_rec.grad_month||'|'||
    cur1_rec.sorhsch_sbgi_code;
    utl_file.put_line(l_output,buffer,false);
    end loop;
    utl_file.fclose(l_output);
    exception
    when no_data_found then
    utl_file.fclose(l_output);
    end;
    /

    Can you be more precise , please :
    - which table stores the people identities ? (I call this one Identity)
    - which table gives the class where the student works in (I cal l this one Claa_attendees)
    - which table gives the instructor of a class (I call this one Class)
    If your issue is that you have one table which stores Itendities , and you need to display Student identity and Instructor Identity, you have to call this table twice in your query , using table aliases . I mean :
    Select Stud_iden.name, Instr_iden.name
    From Identity Stud_iden, Identity Instr_iden, Class_attendees, Class
    Where Class.clas_id = class_attendees.class_id
    and class.instructor_id = Instr_iden.people_id
    and class_attendees.student_id = Stud_iden.people_id
    Is this what you need to do ?

Maybe you are looking for