copy database from one server to another

Posted on 2014-08-10
Last Modified: 2014-08-14
Hi, i have one database called dbtest on Server1 with a lots of tables, storeprocedure, functions, etc. I want that database to be copied to another Server2. I already have another empty database called dbtest in place at the Server2. I added both servers on my sql management studio, but i cant get the query to copy this database from server1 to server2.
Question by:rafaelrgl
    LVL 32

    Expert Comment

    Make a fresh backup of your database. Copy the backup to your second server and restore it there. See Copy Databases with Backup and Restore.
    LVL 1

    Author Comment

    I cant copy the backup to the second server since is on the online hosting company. but I can connect to the second server using sql server management in my computer.
    LVL 30

    Expert Comment

    Using SQL EXPRESS 2014

    For Server1:
    Right click database, tasks-Generate Scripts.
    Save script.

     On server2:
    Run saved script.
    LVL 32

    Expert Comment

    Even when it's on a hosted server, there must be the possibility to get you backup copied. I never heard of a service provider which does not support this.
    LVL 23

    Accepted Solution

    You can copy schema (tables, views, procs, etc.) using Generate Scripts, but it will *not* copy data.  If you have BIDS (Business Intelligence Design Studio) there is a "Copy Database" process in there.

    However, the best solution is as others have said - do a backup, transfer the backup, then do a restore.  Contact your service provider to ask them how to do this in their environment.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now