Mysql database migration

Hello,

I am done with seting up with my linode for my site's requirements.

My site is powered by phpfox.com and I need to move my mysql database over to linode.

I have figured out that I can move my public_html content (php files, html, css, images etc..) to my var/www at linode, but don't know which one to move first, mysql or that conent.

I host my site with tmdhosting and use Cpanel with phpmyadmin etc..

I have A SFTP client installed at my PC and have a backup of my sites content too. the mysql backup is tar.gz but I can backup b\plain or other available formats with phpmyadmin.

the only thing remaining for me to not figure out is this mysql thingy.

Please give me an answer if you will do it serioucely.

thanks

13 Replies

@myusername:

Hi, I was a complete jackass in another thread, but I still need help, so now I'm going to ask for it in a totally fake nice way

:roll:

It doesn't really matter whether you copy the website or the database first. Nothing will work unless both have been copied properly.

Use FileZilla to upload files, it's the most user-friendly tool out there. It's better than WinSCP. Just make sure to select "SFTP" so that FileZilla will use the secure SSH protocol.

Upload all your site's files to /var/www.

Upload the database backup. Put it somewhere outside of /var/www.

Connect to your server. Type

mysql -u root -p

When prompted, enter MySQL's root password. You must have entered this when you installed MySQL. It may or may not be the same as the Linode's root password.

Create a user, create a database, and give the user access to the database.

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE databasename;
GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'localhost';

Make sure you replace username, password, and databasename with appropriate values.

Now, exit MySQL:

exit;

Let's unzip your database backup.

tar zvfx backupfile.tar.gz

You should end up with a bigger file.

Let's import the database into MySQL.

mysql -u username -p < name_of_file_you_just_unzipped

Replace username with the actual value used above. When prompted for the password, supply the password you made up above.

Now, find the PHP file somewhere your website where the database username and password are stored. Edit them to match the new values.

Type the IP address of your server in your browser. (If you already have DNS set up, you can use the actual domain name.) Cross fingers.

When you've verified that everything works, delete the database backup that you've uploaded to your server. You don't want it lying around there.

@glg:

@myusername:

Hi, I was a complete jackass in another thread, but I still need help, so now I'm going to ask for it in a totally fake nice way

:roll:

I did open a new thread because of motherfuckers like you!!!!

I don't fucking ask for help from idiots!!!

Go to sales discations and you will see my first post that I was asking for help and in a nice way, because there were no idiots replaying to my thread, there were people that want to help others!!!

Idiots, don't fucking reply to my thread, I don't need help from idiots!!!

I am sorry that others who are willing to help to see this, and I appreciate their help in this forums not just for me, but for all their help here!

I hate lossers!!! Get a fucking life instead arguying with me about fucking stupid things! I am not here to discusse abolut other things than that help I need and the help I give if I can and will sure do in future.

I am newbie at linux system, is that so fucking stupid???

Where did you learn? Before you was born???

PLEASE, NO MORE SINGEL WORD ABOUT THIS, IF SO OPEN NEW THREAD BY YOUR SELF TOO AND SAY WHAT YOU WANT TO SAY ABOUT MEOR NEWBIES!

@hybinet:

Let's unzip your database backup.

tar zvfx backupfile.tar.gz

You should end up with a bigger file.

Let's import the database into MySQL.

mysql -u username -p < name_of_file_you_just_unzipped

Replace username with the actual value used above. When prompted for the password, supply the password you made up above.

Now, find the PHP file somewhere your website where the database username and password are stored. Edit them to match the new values.

.

Thank you for you help.

I don't get all things here, if you could explain them a litle more newbie freindly.

Where should I upload the database? It is an unzipped package, so can I just copy it to /HOME directory and just name it backup file? The file inside the directory woul look like this: /home/backupfile ?

SO I command this:? code

tar zvfx backupfile.tar.gz

What will happen? Will it unzipp in the same directory(/home) and may rename it?

and here:

mysql -u username -p < name_of_file_you_just_unzipped

The database username will be there, or? assumin my database username is EXAMPLE and the user LIVESITE is gran to EXAMPLE, and my package was Backupfile so it would look like:

mysql -u LIVESITE -p < backupfile

Correct me, if I am wrong..?

PHP file somewhere your website

May I change the mysql user name and password there? Is that a mysql file?

Waiting for your replay.

Appreciate your help and I am sorry for the above replay and hope people like you even do not take a look at it as it is not for poeple like you.

Thank you for your time!

@myusername:

@glg:

@myusername:

Hi, I was a complete jackass in another thread, but I still need help, so now I'm going to ask for it in a totally fake nice way

:roll:

I did open a new thread because of motherfuckers like you!!!!

I don't fucking ask for help from idiots!!!

You reap what you sow, fucktard.

@myusername:

Go to sales discations and you will see my first post that I was asking for help and in a nice way, because there were no idiots replaying to my thread, there were people that want to help others!!!

You never asked in a nice way, fucko.

@myusername:

Idiots, don't fucking reply to my thread, I don't need help from idiots!!!

Why don't you start by following your own advice?

@myusername:

I am newbie at linux system, is that so fucking stupid???

Where did you learn? Before you was born???

You know how I didn't learn? By coming on forums and making an ass of myself.

@myusername:

PLEASE, NO MORE SINGEL WORD ABOUT THIS, IF SO OPEN NEW THREAD BY YOUR SELF TOO AND SAY WHAT YOU WANT TO SAY ABOUT MEOR NEWBIES!

I have said nothing against newbies, only assholes like you.

@myusername:

Where should I upload the database? It is an unzipped package, so can I just copy it to /HOME directory and just name it backup file? The file inside the directory woul look like this: /home/backupfile ?
Anywhere except /var/www would do. It doesn't matter. Uploading the backup is just a temporary step until the contents of the backup can be properly loaded into MySQL. The reason you shouldn't put it in /var/www is because that directory is visible to the whole world, and you don't want your database to be visible to the whole world. Anywhere else would do. /home is perfect.

@myusername:

SO I command this:? code

tar zvfx backupfile.tar.gz

What will happen? Will it unzipp in the same directory(/home) and may rename it?
You'll get a decompressed (unzipped) version of your backup. You can't load a compressed backup directly into MySQL, so you need to unzip it first. I don't know what filename you'll get, it depends on what your other web host did. It'll probably be something like backupfile.sql or similar. Type ls to see the filename after you've unzipped it, or just refresh the folder in FileZilla.

@myusername:

and here:

mysql -u username -p < name_of_file_you_just_unzipped

The database username will be there, or? assumin my database username is EXAMPLE and the user LIVESITE is gran to EXAMPLE, and my package was Backupfile so it would look like:

mysql -u LIVESITE -p < backupfile

Correct me, if I am wrong..?
The username and password should be the same as the one you created a few steps above. And I actually made a mistake above, sorry about that. The correct command is

mysql -u username -p databasename < backupfile

(Notice the databasename. This should be the same as the name you used in the CREATE DATABASE step above.)

@myusername:

PHP file somewhere your website

May I change the mysql user name and password there? Is that a mysql file?
I don't know where the username and password is stored in phpfox. If it was free I could just download a copy and see where it is, but it's not free so I can't tell. Go to the phpfox forum and ask a question there. Tell them you moved your site to a new server and you need to manually edit the database username and password. They'll tell you which lines in which file to edit. It is very important to get this right. Otherwise your site will not know that it's supposed to use your new database.

That's about as far as I can help you, because I don't know how phpfox works and I don't know your exact setup. If there's anything else that doesn't work, you should probably ask the phpfox guys instead of asking here, because very few people here know what phpfox even is.

Thanks.

But I tried all ways I could no one of them worked, sukcs.

I am leaving this fucking supportless thingy pingy tingi hingy….:PPPPPPPP

@myusername:

Thanks.

But I tried all ways I could no one of them worked, sukcs.

I am leaving this fucking supportless thingy pingy tingi hingy….:PPPPPPPP

If every solution fails, maybe you should check for PEBKAC?

Really really really bad support!!

I have seen unmanaged support but not like this one!!!

In the end I got everything running but my site doesn't appeared normally and there were some database or host related issues, but I got no fucking help after 5 days of full work at linooooode!!!

Will come back when I am ingenier or what ever it is called :P

Newbie? mysql, php and apache? Just say bye to linode! Going back to vps even their servers suck!

Who knew that Linode would actually have to post these signs…

![](http://1.bp.blogspot.com/_sI28iJloqVM/R … 0/ride.png">http://1.bp.blogspot.com/_sI28iJloqVM/R5etytxJmSI/AAAAAAAAAbs/myxbLpSxw7I/s200/ride.png" />

I dunno. I can't get it to work either.

[email protected]:~$ fucking help
fucking: command not found
[email protected]:~$ fucking supportless thingy
fucking: command not found
[email protected]:~$ motherfuckers like you
motherfuckers: command not found
[email protected]:~$ singel word about this
singel: command not found

Um… he's using Ubuntu, so wouldn't it be…

[email protected]:~$ sudo fucking help 

Alright, I'm getting tired of this. Could somebody turn off @myusername's "Dumbass" flag? While I can deal with the profanity, all of the misspellings are getting quite annoying.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct