Copied to clipboard

Flag this post as spam?

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


  • David Hammer 41 posts 67 karma points
    Feb 20, 2014 @ 21:48
    David Hammer
    0

    Migrate CE to SQL 2008

    Hey guys!

    I'm currently in a bit of a bind.

    I have developed a fully functional project in umbraco with the installed CE database enabled.

    Seeing as it's size is currently about 400mb, the server has a huge problem using it with live traffic. Therefor I went out and got me self a SQL 2008 database to migrate the CE/.sdf database to.

    In my attempt to achieve greatness, it all has gone horribly wrong. The migration actually worked, and I got a new database connection set up in my project in WebMatrix. Now I thought I could just delete the CE/.sdf and publish it to the server again. This did not work.

    I of course backed the project up before going in to an unexplored territory.

    So yeah what I would like to know is, if any of you guys have had experience with this migration, and if you could possibly explain to me how to go about it, or point me to a solid guide, seeing as I haven't found any that worked yet.

    Sorry for the long rambling. I'm just really really really desperate !!!

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Feb 20, 2014 @ 21:54
    Dennis Aaen
    0
  • David Hammer 41 posts 67 karma points
    Feb 20, 2014 @ 23:10
    David Hammer
    0

    Hey Dennis,

    Thanks for the very quick response! I have now tried going through your links one by one:

    Link 1: He links to a dead site in his guide.

    Link 2: The "Export SQL Server Compact" package he recommends I install gives me the following error, when I try to export the schema and data: [FileNotFoundException: Could not find file 'C:\Users\David Hammer\Desktop\Aller Nyeste Notat\AppData\Umbraco20140220220625.sql'.]

    Link 3: Now I've tried this 4 times, all double checked with the right information, and it doesn't work. It says failed migration every time. :(

    Many thanks, but any other suggestions?

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Feb 20, 2014 @ 23:25
    Dennis Aaen
    0

    Hi David,

    Okay, could this be a guide for you http://erikej.blogspot.dk/2011/03/migrate-sql-server-compact-database-to.html and http://erikej.blogspot.dk/2012/02/migrating-databases-between-sql-server.html

    If you haven't seen these blog posts before. Or you could try to use Lee Kelleher package called Export SQL Server Compact http://our.umbraco.org/projects/backoffice-extensions/export-sql-server-compact

    Hope this can help you.

    /Dennis

  • Dan 1285 posts 3917 karma points c-trib
    Feb 20, 2014 @ 23:35
    Dan
    0

    Hi David,

    I often use SQLCe for initial dev and migrate to SQL Express before going into production (would never use Ce for production, but that's another story...). The best tool I've found for this is SQLCe Toolbox. Note, the only time this has ever failed for me is because the latest version supports SQLCe v4 whereas I think Umbraco uses 3.5. On the link above there's a download for the stand-alone 3.5 export version, which is what I use regularly, and it does work - it maintains all your keys etc.

    The other issue you may face is that most of the tools (including Webmatrix when I last tried) will only deal with SQLCe databases 256Mb or less in size, so this may also be why your conversions are failing. Again SQLCe Toolbox is great because it lets you specify a larger size of db to export - there's an option to tell it how big the database is on the first screen of the app. If the database is huge then it simply generates several SQL files to run in sequence.

    I hope this helps. Let us know if you have any specific issues with it, or alternatively I'd happily try to convert it for you, but I realise security may not allow :)

  • David Hammer 41 posts 67 karma points
    Feb 21, 2014 @ 00:41
    David Hammer
    0

    Hi Dan,

    Thank you too, for the reply, very much appreciated!

    I figured out that the SQLCe version was 4.0, so I downloaded the standalone for 4.0 and I am now the proud owner of a collection of 13 ".sql" files.. -> Woohoo! <-

    Now can you please tell me a little about how I proceed from here?

    I've tried the WebMatrix new umbraco solution, to hook it up to the sql files, and then get the conn.strings from there. Did not work in my short experience.

    Would you elaborate a little on your process perhaps?

    Many thanks!!

  • Dan 1285 posts 3917 karma points c-trib
    Feb 21, 2014 @ 10:04
    Dan
    0

    Hi David,

    Glad that has worked so far!

    From here, I'd open up SQL Server Management Studio (Express) and connect to your SQL 2008 database using the log-in credentials you have - or via WebMatrix if you can connect to the database through that, basically any tool that lets you run a query against the new database. Once connected to SQL Server you can either copy and paste the contents of the first of the 13 .sql files and run that, or open up the sql file (or drag it into the query editor pane - depending on the tool you're using) and run it. Once it has run, do the same with the second .sql file, then the third, all the way to the last one.

    Once each of the 13 SQL scripts have been run you should have a fully working database and you just need to update your database connection string in web.config to point to this new database. The connection string may look something like this:

    <connectionStrings>
        <remove name="umbracoDbDSN" />
        <add name="umbracoDbDSN" connectionString="server=localhost\SQLExpress;database=nameofdatabase;user id=username;password=password" providerName="System.Data.SqlClient" />
    </connectionStrings>
    

    Obviously the server name/ip, username and password will be specific to your set-up.

    Hope this helps get you a bit further...

  • David Hammer 41 posts 67 karma points
    Mar 07, 2014 @ 14:39
    David Hammer
    0

    Hello there.

    I am truly sorry for the late response!

    I would very much like to thank you with your help!

    I opened up Microsoft Studio and queried the sql files, and as soon as that was done,

    I copied your connectionString snippet, changed it to my settings, and everything worked..

    Thank you so much!

Please Sign in or register to post replies

Write your reply to:

Draft