Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

MySQL - move data

Options
  • 26-01-2009 2:28pm
    #1
    Registered Users Posts: 196 ✭✭


    Hi,

    I have a small application, which i developed myself, running on a desktop computer and it uses a mysql database. I now want to move the application to another computer but i want to move the already entered data with it.

    Do i need to run a backup and restore in mysql? And if so how do i do this?

    Or is there a way of just copying the files that the data is saved on and pasting them into the directory of the new machine?


    Thanks


Comments

  • Closed Accounts Posts: 5,284 ✭✭✭pwd


    You should be able to generate scripts I think that will create a duplicate of the database.


  • Registered Users Posts: 1,996 ✭✭✭lynchie


    A mysqldump --all-databases >backup.sql should backup all data.

    Then doing a mysql < backup.sql on the new server should restore it.


  • Registered Users Posts: 196 ✭✭juror


    lynchie wrote: »
    A mysqldump --all-databases >backup.sql should backup all data.

    Then doing a mysql < backup.sql on the new server should restore it.

    Thanks to both for the prompt replies...

    Is that the exact syntax that i need to use?

    mysqldump --all-databases >backup.sql

    and

    mysql < backup.sql


    because it is really important that i don't lose this data


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Download the MySQL manager. It's very easy to do an export/import between different databases with it. I've done it several times between a local database and a shared hosting one.


  • Registered Users Posts: 378 ✭✭sicruise


    You can also load the database in the mysql client console by using the command
    source sqlfilelocation
    


  • Advertisement
  • Registered Users Posts: 197 ✭✭cracker


    The MySQL GUI tools include a Migration Toolkit, basically a wizard that allows you to migrate one database system to another but you can just pick MySQL as the source and destination systems. Just check the advanced options on some of the steps to set destination schema name and what tables, stored procedures etc you want to migrate. Alternatively TOAD has an export wizard which is straight forward.

    Dave


  • Registered Users Posts: 196 ✭✭juror


    cracker wrote: »
    The MySQL GUI tools include a Migration Toolkit, basically a wizard that allows you to migrate one database system to another but you can just pick MySQL as the source and destination systems. Just check the advanced options on some of the steps to set destination schema name and what tables, stored procedures etc you want to migrate. Alternatively TOAD has an export wizard which is straight forward.

    Dave

    Thanks again for the helpful replies.

    To do this do I go into Backup and select New Project?


  • Registered Users Posts: 197 ✭✭cracker


    I think you are using the "mysql administrator" GUI rather than the "migration tool kit". If you have installed all the GUI tools they should both be there.

    If you want to use the Administrator then the backup restore approach should work, as you say just create a new project and select the items to backup. The advantage of this method is that the two computers don't have to be connected. You can save the backup file and just copy it to the other machine and do a restore. Just make sure when doing the backup that you select the option to include the create database and create tables, views etc statements.


  • Closed Accounts Posts: 2,349 ✭✭✭nobodythere


    If you have phpMyAdmin running there's an "Export" button somewhere when you click a database. You can then put it with all the data in a text file, then do "Import" in phpMyAdmin on another computer.

    The MySQL front-end MySQL-Front (free program) can do this also


  • Registered Users Posts: 196 ✭✭juror


    I used the backup, followed by a restore on the new machine.
    Worked a treat, thanks to everyone who contributed.


  • Advertisement
Advertisement