Archive for the ‘Technical Website Design’ Category

19
Jun

Some of us web designers find ourselves having to be technical out of necessity. Yes I mean logging in to the Command line doing some task more suited to a programmer. If you can get one to do this for you then all the more power to you. If not here are some resources. I decided to place this Command Line Reference sheet for download because I tend to use it for reference quite a bit. I have added a few things from other Command Line Reference sheet in to this document. Just open the doc in your favorite text editor and search for the command your looking for.

I would like to highlight one Command that I’ve found super useful for large or small Mysql DB Migrations I would like to Give Props to Dreamhost for having this on their Wiki

Large or Small mysql db migration w/mysqldump

I have used this command to move mysql DB’s in between hosts that are too large to move or download with phpmyadmin, Cocoamysql, etc. this has worked on shared and dedicated servers so lets get to it

Requirements:

have ssh access to both web servers
use of a text editor.
old db to migrate from and a new EMPTY db to migrate to
access to both db’s with the administrative user.

The mysqldump command

Now that you’ve got your old db and new EMPTY db with the users and passwords we’re ready to start

Use the following mysqldump command and replace the filler data in your text editor:

1. oldhost
2. oldusername
3. oldpassword
4. olddbname
5. newhost
6. newusername
7. newpassword
8. newdbname

mysqldump -h oldhost -u oldusername -poldpassword olddbname | mysql -h newhost -u newusername -pnewpassword newdbname

now that we’ve got the mysqldump command filled in with your new data lets get the actual migration going.

Open a new shell window and log into your server.

note that the ssh user needs to be able to access mysql

now that we are logged into the server, cut the mysqldump command from your text editor and paste it in to your open SSH session at the command promt. and click enter!

there you go. if there are no errors then you should have copied the old DB to the new DB on your new host. If you do have errors try using mysqldump command and specifying –verbose it will show you what is going on with your transfer. Let say you have errors in your DB and the mysqldump keeps failing at these errors. try using the force command –force to push the dump through even if there are SQL errors. remember to clean those up after your on your new more capable host! Lastly use mysqldump –help to get a list of all command associated with mysqldump.

Post Sponsored by - VRBO & Background Check & Website Design St. Louis & Employment Screening