Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Berdia 45 posts 67 karma points
    Feb 07, 2011 @ 13:10
    Berdia
    0

    Umbraco sql script to create DB.

    Hi,

    Could somebody please tell me where can I find an SQL script to create Umbraco DB on shared hosting?

    Copying DB from my test environment into the live using SQL import, does not create DB properly.

    Thank you.

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Feb 07, 2011 @ 13:38
    Hendy Racher
    0

    Hi Berdia,

    You should be able to backup your test environment and restore it to live (or even script it out) without problems. Do you get any errors when restoring to live ?

    It might be worth comparing the databases between environments ? (if you're using SQL Express, then the xSQL Bundle has some really useful free tools).

    HTH,

    Hendy

  • Berdia 45 posts 67 karma points
    Feb 07, 2011 @ 14:11
    Berdia
    0

    Hi Hendy,

    I did SQL import and it did not transfer Identifications on some of the tables properly. I fixed some of them but other DB related errors are coming up.

    I can not restore database from my backup file (on local PC) to the hosting environment. My hosting does not allow me to do it.

    Only two things I can do is run script to create database or import. Import does not work.....so.

    Thank you.

  • jc 64 posts 101 karma points
    Feb 07, 2011 @ 14:31
    jc
    1

    If you download source from codeplex, there is an install script in:

    SQL Server: ~\umbraco\datalayer\SqlHelpers\SqlServer\Sql\Total.sql

    MySQL: ~\umbraco\datalayer\SqlHelpers\MySql\Sql\Total.sql

  • jc 64 posts 101 karma points
    Feb 07, 2011 @ 14:34
    jc
    0

    Like Hendy said, you should also be able to generate an sql script of your current database with all data

  • Berdia 45 posts 67 karma points
    Feb 07, 2011 @ 15:28
    Berdia
    2

    It is all done! Here is what I did.

    First I created a blank SQL database on my shared hosting. Then:

    I have created DB script from VS 2010.

    1. Open Visual Web Developer Express 2010/VS 2010 Pro
    2. Open Database Explorer (View -> Database Explorer) (in Visual Studio 2010 you will open "Server Explorer").
    3. The Database Explorer should show up on the right side of the IDE.
    4. Right click Data Connections and select Add Connection.
    5. Enter the server name in the first text box (type the name of your local SQL Server).
    6. Type the name of the database in the database name field and click "OK."
    7. In Database Explorer you will see your local database.  Right click on it and choose Publish to Provider.

    Then:

    To generate the script that will create the backup of your database follow the steps listed below.

    1. Click "Next" on the welcome screen of Publishing Wizard.
    2. Insure that your database is selected, check Script all objects in the selected database and click "Next."
    3. Choose the Script to file option and type the name of the script you will be generating. Click "Next."
    4. Leave the default Publishing Options and click "Next."
    5. Click "Finish."

    After that:

    1. Open your database in SQL Server Management Studio 2008.
    2. Click File/Open/File and navigate to the SQL script you just created from your SQL Server.
    3. Input your database login and password from Control Panel
    4. Once the script is opened, navigate to the very top of the page and type:
      • USE [database name] (without the brackets)
      • GO
    5. Click the "Execute" button.

    It creates all tables exactly the same as you have in your local DB. I use WinHost hosting and it is working absolutely fine. I am sure it will be pretty much the same for other hosting providers. Hope others find this helpful.

    Works like a charm!

    Thank you all for your help!

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Feb 07, 2011 @ 15:54
    Hendy Racher
    0

    Hi Berdia,

    That's great, does it script the data too ?

    Hendy

  • Berdia 45 posts 67 karma points
    Feb 07, 2011 @ 17:09
    Berdia
    0

    Yes it absolutely did!

  • Nick Portelli 76 posts 102 karma points
    Feb 07, 2011 @ 18:31
    Nick Portelli
    0

    I've used the SQL Management Studio to generate the tables and http://www.ssmstoolspack.com/ to generate the inserts for data.  

Please Sign in or register to post replies

Write your reply to:

Draft