Copying Tables RRS feed

  • Question

  • User287301797 posted


     First, let me say that I'm very impressed with how well Web Matrix deployed, very smoothly. 

    I'd like to copy my wordpress database (sql) tables to my computer so I can copy it over to my new server(or some way to export them), where I have already named a database to transfer these files in to.

    So far I was succesful in creating a .sdf file (nothing in it yet). I think that may be how to do it but any help in accomplishing my goal would be appreciated.

    I hear the .sdf file is not going to accomplish what I want, so, in short, I'm trying to export those tables so I can continue my installation at my server.

    Friday, January 6, 2012 5:00 PM


All replies

  • User1876843787 posted

    can you migrate your sdf file to sql server?

    when you select your sdf file node, there is a migrate button enabled on the tool bar.

    Friday, January 6, 2012 5:32 PM
  • User287301797 posted
    I saw that, however, I'm concerned that the sdf file isn't the correct structure for myphp.
    Friday, January 6, 2012 5:49 PM
  • User1876843787 posted

    do you mean you are worrying the migration will cause sdf to wrong structure?

    Friday, January 6, 2012 5:52 PM
  • User287301797 posted

    in short, yes.

    Also, when I try to view the contents, nothing shows under the tables.

    I'm installing sql server express as we speak.

    Friday, January 6, 2012 6:02 PM
  • User1876843787 posted

    if this is what you are worrying, why not copy the sdf directly to your new machine and put it under your website folder?

    this is the path you can find the sdf file

    Documents\My Web Sites\[your site name]\App_Data

    Friday, January 6, 2012 6:05 PM
  • User287301797 posted

    I saw that as I hovered....I'm going to give it a shot.

    Thanks Ye, I'll let you know how I make out.

    Friday, January 6, 2012 6:08 PM
  • User287301797 posted

    I guess it didn't work! this is what I got:

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '&¢]8' at line 1

    I think it has to do with the .sdf extension.  

    Friday, January 6, 2012 6:22 PM
  • User1876843787 posted

    are you using mysql or sql ce?

    I'm a little confused?

    do you mind share me your sql file?

    Friday, January 6, 2012 6:25 PM
  • User287301797 posted

    I'm using mysql...

    This is what I'm trying to do.

    I changed servers and ftp'd my site over to the new server. Somehow during ftp something went wrong and my site became corrupted. I then sent my backed up site on a tar.gz file to the new server, they opened the file, but my site was still not working (all my files are there), they suggested I should re-install my site, and move the files over.

    I thought about it and figured that my database might also be corrupted so I'm trying to set up a new one with the fresh install I just created on web matrix and move the DB over to the new server. In the end, I thought it would be easier to move this DB over than all the other files to matrix and then back over to the new server.

    Kudos to you if you can make sense of the above!

    Friday, January 6, 2012 6:55 PM
  • User1876843787 posted

    where is your database located now, mysql or sql ce?

    if in mysql, you can use following solution to export
    1. Command line
    2. Using PHPMYADMIN.

    In command line you can back up your database using one of the following technique.
    mysql> mysqldump DBname [table names];

    [table names]-> your tables that u want to back up.

    -Open phpmyadmin
    -select your DB
    -select Export from top menu
    -select all tables from side List.
    -Check the checkbox that label "Save file as"
    -click the Go button to save your DB; with all the records been saved as well.

    if it's in sql ce, I don't think your sql ce file it corrupted. if you will continue to use sql ce, why can't you just copy-paste your sql ce file to new server?

    Friday, January 6, 2012 7:04 PM
  • User287301797 posted

    I have mysql.

     I have a DB with my old tables, but those are the ones I think are not complete, or corrupted, which is why I'm trying to import the new DB from Matrix.

    I did the migration which only backs up the DB with the .sdf.backup extension.

    At this point I'm thinking to bring the files over to my computer from server and start over again.

    Friday, January 6, 2012 7:32 PM
  • User1876843787 posted

    do you mean you migrate db from sql ce to mySql in webmatrix fail and you want to copy the sdf file to new server?

    Friday, January 6, 2012 7:40 PM
  • User287301797 posted
    Friday, January 6, 2012 7:54 PM
  • User1876843787 posted

    so you migrate the sql ce fail?

    do you mind share your sql ce file so I can help investigate on my machine?

    Friday, January 6, 2012 7:56 PM
  • User1876843787 posted

    sorry, I just remember migration to mysql has not been supported.

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Friday, January 6, 2012 8:02 PM
  • User287301797 posted
    ok...thanks for your help!
    Friday, January 6, 2012 8:19 PM
  • User-1672167363 posted


    Some other  tools and methods you might use:

    Is the Web Deploy installed http://erikej.blogspot.com/2011/03/migrate-sql-server-compact-database-to.html this may work for you.

    You can use the Web Plaform Tool  http://learn.iis.net/page.aspx/616/using-the-microsoft-web-platform-installer/ to install

    the SQL Server 2008 items

    SQL Server 2008 R2  SQL Server 2008 Express SP1 Database. 

    SQL Server 2008 R2 Management Studio Express it can be used with the SQL Compact Databases.

    Look at Eriks Blog he has lots of SQL Compact information. 

    You could use  SQL Server Studio Managment  part of the migration.


    Then use SQL Server Studio Managment to export the Database to to a raw format csv etc.

    Then Download and install http://www.heidisql.com/ use this  http://www.heidisql.com/screenshots.php?which=import_textfile 

    information to import the csv database.

    The remaing steps would maybe with SQL Language command issues  http://dev.mysql.com/doc/ MySQL Server.

    We hope the above helps,

     Late yesterday Ye Yu and I have been discussing other ways for your tasks,



    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Saturday, January 7, 2012 1:58 AM
  • User287301797 posted

    Thanks Martin.

     A lot to digest, but I'll look at it all!

     I took a bit of a diffrent approach. Instead of exporting to the new server, I decided to import in to the test site.

     That worked, thought it wasn't without it's consequences! I got a 500 server error. I'll post this as a new thread.

     Your attention and Ye Yu's is very much appreciated.


    Saturday, January 7, 2012 3:01 PM
  • User-1672167363 posted

    Hi Ray,

    The thread http://forums.iis.net/t/1174698.aspx did post a reply.

     Thank you again  for selecting the Web Platform and the current tools.

    Ye Yu and I  thank you for investing your time with the problems and issues.

    The Web Matix did not make this easy or automatic this is still a WIP.

    Trying other methods to migrate databases can be complex.







    Saturday, January 7, 2012 7:21 PM