views:

175

answers:

3

I've been building a joomla-based website for the past couple of months and the time has come to migrate the site from my personal development server to the production one. My initial thought was to dump the database and recreate it on the production server, but I'm wondering if there is a better way. Unfortunately there is some content already present on the development server that I need to preserve, otherwise I would just "reinstall" and apply the template I created.

Any thoughts?

Thanks, Chris

A: 

Unfortunately you can't copy the mdf and ldf files like a MSSQL database and reattach. The following is an article on how to copy a MySql database from one server to another.

Copy MySql Database

gsirianni
Thanks for the link, that's helpful. Do you know of any problems utilizing a mysqldump-created file with phpMyAdmin? unfortunately, I don't have shell access to the production server
Chris Thompson
I've copied the database folder before now to duplicate a database, is there a reason this wouldn't work across servers?
DisgruntledGoat
in 99% of the cases you have phpmyadmin available and then there is really no need to do it the complicated shell way.
tharkun
If you have Webmin it's not complicated at all ;) You just do to the MySQL folder then copy-paste-rename the folder. Much quicker and easier than going through phpMyAdmin, especially for databases larger than a few MB (which are difficult to import into PMA).
DisgruntledGoat
A: 

Yep, under your mysql installation (normally somewhere like /lib/mysql) there should be a folder for each database. You can simply copy this, eg download as a zip file, upload to new location and extract. It definitely works to copy databases on the same server, don't see why it wouldn't work on a different server.

If it doesn't though, you can use something like PHPMyAdmin (probably simpler, actually). Just log in, select the database then click Export on the top of the right frame. Tick to save as file. You can then import this on your new server.

DisgruntledGoat
+2  A: 

First of all I would like to point out that you need not meddle with /lib/mysql, or mysqldump if you have a phpmyadmin on both platforms. Moving mysql databases around is really easy and secure just with exporting structure and data as 'sql' and running the whole thing as query in the new place.

Plus there is the great 'JoomlaPack' which is probably what you want to use anyways. JoomlaPack can backup your entire site including additional databases, etc. and reinstall the whole package using a modified JoomlaInstaller on any other server.

Now in your case the whole thing is a bit more complicated than this because you have content on each server and if I get you right you need to merge the content.

Possible solutions:

1) How much content do you need to merge? If the amount of content on the production server is small, just hand-migrate it to your test environment first, then use JoomlaPack to make a full backup, upload the backup to your production environment and use the JoomlaPack installer to make a fresh install of Joomla including your data and everything!

2) If it is a bit more, you can start with a 'diff' (comparison) of the 'sql' data dumps of both versions then merge that data carefully and proceed as in 1). You can use WinDiff for this or TortoiseDiff if you have TortoiseSVN installed.

tharkun
That's exactly what I was looking for, thanks!
Chris Thompson