Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Mysql database migration
PostPosted: Fri Oct 29, 2010 6:55 pm 
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


Top
   
PostPosted: Fri Oct 29, 2010 10:54 pm 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
myusername wrote:
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:


Top
   
 Post subject:
PostPosted: Fri Oct 29, 2010 11:30 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
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

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

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

Code:
exit;


Let's unzip your database backup.

Code:
tar zvfx backupfile.tar.gz

You should end up with a bigger file.

Let's import the database into MySQL.

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


Top
   
PostPosted: Sat Oct 30, 2010 5:41 am 
glg wrote:
myusername wrote:
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!


Top
   
 Post subject:
PostPosted: Sat Oct 30, 2010 6:05 am 
hybinet wrote:
Let's unzip your database backup.

Code:
tar zvfx backupfile.tar.gz

You should end up with a bigger file.

Let's import the database into MySQL.

Code:
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
Code:
tar zvfx backupfile.tar.gz

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

and here:
Code:
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:
Code:
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!


Top
   
PostPosted: Sat Oct 30, 2010 9:10 am 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
myusername wrote:
glg wrote:
myusername wrote:
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 wrote:
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 wrote:
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 wrote:
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 wrote:
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.


Top
   
 Post subject:
PostPosted: Sat Oct 30, 2010 5:22 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
myusername wrote:
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 wrote:
SO I command this:? code
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 wrote:
and here:
Code:
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:
Code:
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

Code:
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 wrote:
>>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.


Top
   
 Post subject:
PostPosted: Mon Nov 01, 2010 3:55 am 
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


Top
   
 Post subject:
PostPosted: Mon Nov 01, 2010 12:46 pm 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
myusername wrote:
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?


Top
   
 Post subject:
PostPosted: Mon Nov 01, 2010 5:47 pm 
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!


Top
   
 Post subject:
PostPosted: Mon Nov 01, 2010 6:48 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Who knew that Linode would actually have to post these signs...

Image


Top
   
 Post subject:
PostPosted: Mon Nov 01, 2010 7:37 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
I dunno. I can't get it to work either.

Code:
rtucker@arrogant-bastard:~$ fucking help
fucking: command not found
rtucker@arrogant-bastard:~$ fucking supportless thingy
fucking: command not found
rtucker@arrogant-bastard:~$ motherfuckers like you
motherfuckers: command not found
rtucker@arrogant-bastard:~$ singel word about this
singel: command not found

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Mon Nov 01, 2010 7:55 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Um... he's using Ubuntu, so wouldn't it be...

Code:
rtucker@arrogant-bastard:~$ sudo fucking help 


Top
   
 Post subject:
PostPosted: Tue Nov 02, 2010 9:29 am 
Offline
Senior Member

Joined: Sat Feb 14, 2009 1:32 am
Posts: 123
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.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group