Jump to content


Photo

testing server


  • Please log in to reply
8 replies to this topic

#1 Woodburn2006

Woodburn2006
  • Members
  • PipPipPip
  • Advanced Member
  • 214 posts

Posted 13 September 2006 - 07:10 PM

when i build sites i use the testing apache server i have on my machine and then upload once i have completed the project.

is there any way of replicating my mysql database from my machine to the server without having to re-build the mysql database on the server?

#2 orion2004

orion2004
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 13 September 2006 - 07:14 PM

not 100% sure but cant you just export the database to a text file and import it onto your other database?

#3 redRemedy

redRemedy
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 13 September 2006 - 07:25 PM

If you use the phpMyAdmin on both your local test machine and your production server, you will find that there is several exporting options for you to choose from. phpMyAdmin also offers an online documentation.

#4 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 13 September 2006 - 07:28 PM

Why don't you just connect remotely?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#5 Woodburn2006

Woodburn2006
  • Members
  • PipPipPip
  • Advanced Member
  • 214 posts

Posted 14 September 2006 - 04:00 PM

ok will have a look, if i connect remotely then it is harder to make changes to a working site. i will have to keep uploading everytime i make a slight change in code and if i am doing a tricky bit i always do a bit at a time and test, it will take to long if i have to upload it all of the time

#6 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 14 September 2006 - 05:04 PM

I don't know what you mean by "upload it all"... I'm talking about a remote DB connection.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#7 Woodburn2006

Woodburn2006
  • Members
  • PipPipPip
  • Advanced Member
  • 214 posts

Posted 14 September 2006 - 05:48 PM

ah right sorry i thought you were talking about the site itself. i sometimes do the work on my laptop, therefore i cant always have access to the DB as im not near an internet connection

#8 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 14 September 2006 - 06:00 PM

Well, if you don't really care about how "up-to-date" it is, you can always since have a daily dump, and pull it down via whatever, blow away your local copy, and start fresh.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#9 shoz

shoz
  • Staff Alumni
  • Advanced Member
  • 600 posts

Posted 14 September 2006 - 06:57 PM

It looks like he just wants to be able to copy the local db to the remote db once. By "without having to re-build", I think he means without having to recreate all the tables by hand and enter all the information as he did on his local server.

If that's the case then using PhpMyadmin's export option as mentioned earlier in the thread should be what you're looking for. I'm not very familiar with PhpMyadmin, but it should be a straight forward process.

Instead of using Phpmyadmin, you can do it by hand using "mysqldump" and "mysql" to do the copy.

Backup on test server
mysqldump --opt dbname > file.sql

Restore on production server
mysql dbname < file.sql

//or as a query
SOURCE /path/to/file.sql

You can compress the sql file to make it much smaller and upload the compressed file. There should also be a similar option in Phpmyadmin.

In linux
mysqldump --opt dbname | gzip -c > file.sql.gz





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users