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?


openSUSE 11.1 x86_64; Kernel 2.6.27-9; KDE 4.2.87; Intel Core 2 Quad
Q6600 @ 2.4Ghz; 6GB DDR2 RAM; 640GB SATA HDD.

zak89’s Profile: http://forums.opensuse.org/member.php?userid=10788
View this thread: http://forums.opensuse.org/showthread.php?t=405454

-----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-----

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


openSUSE 11.1 x86_64; Kernel 2.6.27-9; KDE 4.2.87; Intel Core 2 Quad
Q6600 @ 2.4Ghz; 6GB DDR2 RAM; 640GB SATA HDD.

zak89’s Profile: http://forums.opensuse.org/member.php?userid=10788
View this thread: http://forums.opensuse.org/showthread.php?t=405454

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

roberto60’s Profile: http://forums.opensuse.org/member.php?userid=5557
View this thread: http://forums.opensuse.org/showthread.php?t=405454

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,


john_hudson

john_hudson’s Profile: http://forums.opensuse.org/member.php?userid=1134
View this thread: http://forums.opensuse.org/showthread.php?t=405454

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…


yu210148

yu210148’s Profile: http://forums.opensuse.org/member.php?userid=19157
View this thread: http://forums.opensuse.org/showthread.php?t=405454

I would give a try to “webmin”.:slight_smile:
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

roberto60’s Profile: http://forums.opensuse.org/member.php?userid=5557
View this thread: http://forums.opensuse.org/showthread.php?t=405454

Not sure if it’s in the standard repos but it’s available from ‘Webmin’
(http://www.webmin.com/)


yu210148

yu210148’s Profile: http://forums.opensuse.org/member.php?userid=19157
View this thread: http://forums.opensuse.org/showthread.php?t=405454

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.


smpoole7

smpoole7’s Profile: http://forums.opensuse.org/member.php?userid=13513
View this thread: http://forums.opensuse.org/showthread.php?t=405454