Moving a Site with SQL Databases

Status
Not open for further replies.

jerxs

New member
Jun 24, 2006
1,806
24
0
North East PA
Im going to have to move one of my sites to a different hosting account. I currently have two SQL databases set up on the server where the site is. One for a phpBB forum and one for a Wordpress blog. I think I can handle transfering all info except for the databases. I have no idea what to do about them. Is there an easy way of tranfering SQL databases? I dont want to lose rank or the little placement I have with the search engines.

Your help would be much appreciated,
Jer
 


I believe both Wordpress and PHPBB have their own special backup tools so u just download the backup, upload PHPBB on the new server, install it and upload this backup - so check out the official sites.
 
Im aware of the backup tools, but how the hell do I install the backups into a new database without screwing anything up? If it were that easy to me I would not be asking this question, but I know shit about databases. About the only thing I know about DB's is that they contain information for use:anon.sml:

I have not found anything on either of the two sites that explains how move your forum or wordpress blog to a different server without down time or without screwing your position or rank within SE's, nor have I found any information on how to transfer a database to a different mySQL server period. If im missing something could you please provide a link to the info on these sites and I wont bother yah with the newbie DB questions.

Its a scary thought to me that I need to move this site, im walking a thin line the way it is and really dont want to screw myself.

Thanks, Jer
 
I believe you can just do a MySQL dump for Wordpress (and maybe for the forum too?):

http://sqldump.sourceforge.net/

It's easier than you probably think, but I think it probably varies depending on what host you have, as far as how exactly to do it. In Dreamhost there's a MySQL control panel, and an import and export button. You'd just want to export the data base, and it'll save as an sql file, which you then import into the other host.

I know very little about databases, but the few times I've had to do this I haven't had any problems.
 
Thank you, please excuse my my last post if It seems rude. I read it this morning and thought to myself, "boy Jer you sound like a real a-hole. It was not intended that way, I was just speeking loosely and out of frustration. Not intended to disrespect you Dave!

I may just bite the bullet and try to find someone for hire that will do the transition seemlessly for me.

Thanks for the replys
 
Jerxs, if that doesn't work let me know if you have myphpadmin installed on your webserver (best tool to use for this type of work/maintenance) and l will either do it for you, or write a tutorial on how it's done -- though it's very easy.
 
Thanks man, I do have phpMyAdmin on my server, if your up for writing the tutorial I will give it a shot.:bowdown:
 
Alright cool deal 1 question - what is the size of your database backup?
I ask this because it seems that myphpadmin has trouble with 'larger' (51,200KB or bigger) backup files .. If l run into this problem my current provider has a "restore large backup" feature outside of the myphpadmin module that makes it easy for me to do. However if l was hard pressed l could either a.) break the backup (dump) file into smaller bits, and just run several sql queries on the database until the database is restored.

So anyway, on with the meat and potatos...

1.) create a new database (copy down the name of the database)
2.) create a user with password. (copy down the username and password)
3.) give the user you just created admin permissions onto the database you'd just created.

^This should be very easy to do for anyone, as most hosts have a utility or module installed that will allow you to do this with relative ease.


If your database backup file is bellow 51,200KB's in size:

1.) Open up myphpadmin, and select your database's name from the drop down menu in the drop-down box found in the left pane of myphpadmin.

2.) Depending on what version of myphpadmin is installed for you:
Choose the "Import" tab long the top of the main pane of myphpadmin. If you do not have an "Import" tab; select "SQL".

3.) From here it is just a matter of clicking "browse" // finding your backup file and clicking "go"...

This will upload your backup file, and execute it as a giant SQL statement, thus injecting your data into your new database.

--------------
What if your backup is 'large' (51,200KB) and you can't use myphpadmin to import it. Well if your provider doesn't have a nifty restore feature such as jaguar.com (<-great host BTW guys) here are two other sure fire ways to get your database back up and running:

Note: for either of these to work, you need to unzip/untar your backup file, so that is in *.sql file format, and upload it onto your server somewhere. (behind /public_html is the safest place to store it btw)

Option #1.)
Use telnet to run the following UNIX command:
mysql -uSQL_USER -pYES DATABASE_NAME < backup_file.sql

Obviously you need CG access on your server to use Telnet, and not all hosts allow you to access telnet even if you do have CGI. Why? because it's a very dangerous utility and if left unchecked anyone with a reasonable understanding of the UNIX command line could not only delete your site, but potentially other users that are hosted on the same server as you. So long story short, once you are done with this DELETE THE TELNET FROM YOUR SERVER! You can find a free cgi telnet that works just fine for this is attached to this post. Alternatively searching google for "simple telnet script" will return several thousand other options.


Option #2.)
Alternatively the following PHP file will do the same thing (given that your server is configured properly):
PHP:
<?php
$dbname = "DATABASE"; //<-database name
$uname = "USER"; //<-database user name
$upass = "PASSWORD"; //<-database user password
$sql = "/FULL/PATH/TO/BACKUP.sql";
 
$dump = system("mysql -u$uname -p$upass $dbname < $sql");
 
if($dump){
echo "Database dump successful"; 
}else{
echo "Error dumping database";
}
exit;
?>

Essentially this will do the same thing that the UNIX command above will do. Again, your host will have to allow you to execute shell commands with PHP for this to work (most do).

If you still have problems after reading this, please feel free to contact me via email at jeffspicher[at]gmail.com or on msn IM at coastalweb[at]hotmail.com and l would be more than happy to assist you free of charge - and would literally take me no more than 5 minutes to do. Given that your host has the tools and utilities l would need to preform this.

Best of luck, and please let us know how it turns out!
 

Attachments

  • telnet.txt
    2.5 KB · Views: 1
Thak you Jeff, I will have to check the DB size. The forum is pretty small 50 members 1500 posts or something and the WP is pretty small, so I dont think I have to worry about size, but will check.

Im gonna give it a go within the next couple of days. I need a few hours without the kids running around screamin in my ear before I attempt to move the site and DB's

Thanks again and I will post here after I give er a go

Jer
 
Status
Not open for further replies.