Results 1 to 10 of 10

Thread: Migrating a MySQL database?

  1. #1
    Join Date
    Sep 2008
    Location
    St Louis, MO USA
    Posts
    398

    Default Migrating a MySQL database?

    I am trying to clone a linode vm image from a linode540 to a linode360 (running openSUSE 10.3). However, I need to resize the larger linode image before cloning, and I want to make sure everything is backed up before I try resizing. However, I don't know how to back up my mysql database. I don't want to risk losing my db data if the resize is not successful. Are there certain files that I should move?
    Dell Inspiron 530 - C2Q@2.4Ghz; 6GB RAM; openSUSE 11.2 x86_64; KDE 4.4.1
    Dell Inspiron 1440 - C2D@2.2Ghz; 4GB RAM; openSUSE 11.2 x86; KDE 4.4.1
    Dell Latitude D531 - AMD Turion X2 64@2.0Ghz; 2GB RAM; Linux Mint 8

  2. #2
    ab@novell.com NNTP User

    Default Re: Migrating a MySQL database?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    If nothing else, mysqldump

    Also backup /var/lib/mysql (or wherever else your DB files are stored).

    Good luck.





    zak89 wrote:
    > I am trying to clone a linode vm image from a linode540 to a linode360
    > (running openSUSE 10.3). However, I need to resize the larger linode
    > image before cloning, and I want to make sure everything is backed up
    > before I try resizing. However, I don't know how to back up my mysql
    > database. I don't want to risk losing my db data if the resize is not
    > successful. Are there certain files that I should move?
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFJdNbw3s42bA80+9kRAjpcAJ45MOQYsIvk6gqhayuzr+/mH5bgBwCfVrOj
    sqreteiMoKxg27Lr3IVRRXg=
    =UB6j
    -----END PGP SIGNATURE-----

  3. #3
    Join Date
    Sep 2008
    Location
    St Louis, MO USA
    Posts
    398

    Default Re: Migrating a MySQL database?

    Also backup /var/lib/mysql (or wherever else your DB files are stored).
    I think that's what I am trying to figure out. Where are the DB files stored by default? This is just a default openSUSE mysql installation.
    Dell Inspiron 530 - C2Q@2.4Ghz; 6GB RAM; openSUSE 11.2 x86_64; KDE 4.4.1
    Dell Inspiron 1440 - C2D@2.2Ghz; 4GB RAM; openSUSE 11.2 x86; KDE 4.4.1
    Dell Latitude D531 - AMD Turion X2 64@2.0Ghz; 2GB RAM; Linux Mint 8

  4. #4

    Default Re: Migrating a MySQL database?

    You should find a directory with the same name of your database under
    /var/lib/mysql
    with the relevant files.
    This is on my standard opensuse 11.0
    Saluti
    R

  5. #5
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,454

    Default Re: Migrating a MySQL database?

    This is the command if you have logging turned on; remove -F and the references to master data and logs if you don't (but not -A):

    mysqldump -u root -p -F --master-data=2 -A --delete-master-logs > Filename.sql

    This creates an entire script in Filename.sql which you get mysql to run to restore everything,
    Last edited by john_hudson; 20-Jan-2009 at 13:24. Reason: Additional comment

  6. #6
    Join Date
    Jan 2009
    Location
    Toronto, Ontario
    Posts
    188

    Default Re: Migrating a MySQL database?

    I know some people have a love/hate relationship with webmin (people either love it or hate it) but I use it for a point and shoot mysql backup.

    With webmin installed point a browser to https://127.0.0.1:10000 then navigate to the mysql server configuration. You'll be shown a list of your databases click on the one you'd like to back up and click the button marked 'backup database'. Enter (or browse to) a directory path that you've got write access to and give it a filename; you can select specific tables to back up or take the whole thing, there's also option for compression formats if you'd like, and even a way to set it up to back up on a schedule. Then, down at the bottom there's a button for 'Save and Backup Now'. Clicking that will generate a file containing the data in that database which can be used to restore to the new location.

    I know it's essentially doing the same thing as the mysqldump referenced above but for those graphically inclined...

  7. #7

    Default Re: Migrating a MySQL database?

    I would give a try to "webmin".
    I pointed to 127.0.0.1.10000 with no success probably it is not installed on my system.
    Which packages have I to install? And information for documentation?
    Saluti
    R

  8. #8
    Join Date
    Jan 2009
    Location
    Toronto, Ontario
    Posts
    188

    Default Re: Migrating a MySQL database?

    Not sure if it's in the standard repos but it's available from Webmin

  9. #9
    Join Date
    Oct 2008
    Location
    Birmingham. AL
    Posts
    858

    Default Re: Migrating a MySQL database?

    Another beautiful front end is PhpMyAdmin. It's included with most distros. I installed it last night under Opensuse 10.3 on my machine at home.

  10. #10

    Lightbulb Re: Migrating a MySQL database?

    In 11.0 there is also

    MySQL Administrator version 1.2.12

    that can manage the backup/restore task.
    Saluti
    R

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •