We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Copying Tables [Answered]RSS

19 replies

Last post Jan 07, 2012 07:21 PM by HCamper

  • Copying Tables

    Jan 06, 2012 05:00 PM|raygarcia|LINK

    Hello,

     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.

    tables SQL Import export

  • Ye Yu Ye Yu

    48 Posts

    Microsoft

    Re: Copying Tables

    Jan 06, 2012 05:32 PM|Ye Yu|LINK

    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.

  • Re: Copying Tables

    Jan 06, 2012 05:49 PM|raygarcia|LINK

    I saw that, however, I'm concerned that the sdf file isn't the correct structure for myphp.
  • Ye Yu Ye Yu

    48 Posts

    Microsoft

    Re: Copying Tables

    Jan 06, 2012 05:52 PM|Ye Yu|LINK

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

  • Re: Copying Tables

    Jan 06, 2012 06:02 PM|raygarcia|LINK

    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.

  • Ye Yu Ye Yu

    48 Posts

    Microsoft

    Re: Copying Tables

    Jan 06, 2012 06:05 PM|Ye Yu|LINK

    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

  • Re: Copying Tables

    Jan 06, 2012 06:08 PM|raygarcia|LINK

    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.

  • Re: Copying Tables

    Jan 06, 2012 06:22 PM|raygarcia|LINK

    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.  

  • Ye Yu Ye Yu

    48 Posts

    Microsoft

    Re: Copying Tables

    Jan 06, 2012 06:25 PM|Ye Yu|LINK

    are you using mysql or sql ce?

    I'm a little confused?

    do you mind share me your sql file?

  • Re: Copying Tables

    Jan 06, 2012 06:55 PM|raygarcia|LINK

    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!

  • Ye Yu Ye Yu

    48 Posts

    Microsoft

    Re: Copying Tables

    Jan 06, 2012 07:04 PM|Ye Yu|LINK

    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.

    1. COMMAND LINE.
    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.

    2.
    -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?

  • Re: Copying Tables

    Jan 06, 2012 07:32 PM|raygarcia|LINK

    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.

  • Ye Yu Ye Yu

    48 Posts

    Microsoft

    Re: Copying Tables

    Jan 06, 2012 07:40 PM|Ye Yu|LINK

    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?

  • Re: Copying Tables

    Jan 06, 2012 07:54 PM|raygarcia|LINK

    yes
  • Ye Yu Ye Yu

    48 Posts

    Microsoft

    Re: Copying Tables

    Jan 06, 2012 07:56 PM|Ye Yu|LINK

    so you migrate the sql ce fail?

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

  • Ye Yu Ye Yu

    48 Posts

    Microsoft

    Re: Copying Tables

    Jan 06, 2012 08:02 PM|Ye Yu|LINK

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

  • Re: Copying Tables

    Jan 06, 2012 08:19 PM|raygarcia|LINK

    ok...thanks for your help!
  • Re: Copying Tables

    Jan 07, 2012 01:58 AM|HCamper|LINK

    Hello,

    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.

     http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/792745f9-b1ee-4e5e-b372-583a1054c8a8/ 

    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,

    Regards, 

    Martin

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: Copying Tables

    Jan 07, 2012 03:01 PM|raygarcia|LINK

    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.

    Ray

  • Re: Copying Tables

    Jan 07, 2012 07:21 PM|HCamper|LINK

    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.

    Regards, 

    Martin

     

     

     

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011