Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The complete website is now displayed locally -> Login
Code:
WordPress has been updated! Before we send you on your way, we have to update your database to the newest version.
The update process may take a little while, so please be patient.
[Update WordPress Database]
click [Update WordPress Database]
Code:
Update Complete
Your WordPress database has been successfully updated!
[Continue]
click [Continue]
Login to the website.
Lot of thanks for your assistance !!!
It is rather tricky to copy/clone/mirror the Live WordPress website to local server. There are many suggestions/articles on Internet in this respect. Which of them can work? We have to test them. Fortunately I make this test on VM. If failure I just clone another VM on the original VM and start another test.
I'll write down all steps and post the same here later for the benefit of other readers.
Warning: <opinion>
Any tutorial that "explains" how to do things using a GUI interface (phpMyAdmin included) is a crutch.
</opinion>
As you have seen, it can all be down without phpMyAdmin and possibly in less time or just as much time.
My opinion may seem harsh, but trust me after doing this maybe 3 times, it becomes rather pedestrian to move a site to a new host
and you won't even think twice about doing it again in the future.
1.) Export the .sql
2.) copy the file.sql to the new host.
3.) create wp db +user +access privileges
4.) Import the file.sql
5.) Edit wp-config.php for db, user and password
6.) edit the siteurl via mysql
7.) Enjoy your migrated site.
I have a manual script I use to backup my GoDaddy db and the hardest part was figuring out the "-h<dbhost>" part of it.
Once I had that, I can backup the entire site in less than 1 minute.
Yes. The Live website cloned was for testing only, its building NOT completed. Once having mastered the steps I'll clone the running websties on Godaddy server.
Quote:
Warning: <opinion>
Any tutorial that "explains" how to do things using a GUI interface (phpMyAdmin included) is a crutch.
</opinion>
As you have seen, it can all be down without phpMyAdmin and possibly in less time or just as much time.
My opinion may seem harsh, but trust me after doing this maybe 3 times, it becomes rather pedestrian to move a site to a new host
and you won't even think twice about doing it again in the future.
1.) Export the .sql
2.) copy the file.sql to the new host.
3.) create wp db +user +access privileges
4.) Import the file.sql
5.) Edit wp-config.php for db, user and password
6.) edit the siteurl via mysql
7.) Enjoy your migrated site.
I have a manual script I use to backup my GoDaddy db and the hardest part was figuring out the "-h<dbhost>" part of it.
Once I had that, I can backup the entire site in less than 1 minute.
I tried cloning piano-03.satimis.com on Godaddy to local server but no tables exported. I tried 3 times. I paid special attention to;
Code:
[check] Enclose table and field names with backquotes
Export and Import without complaint.
mysql> show databases;
Code:
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sat1318107284790 |
| test |
| wordpress |
+--------------------+
6 rows in set (0.00 sec)
mysql> USE sat1318107284790; SHOW tables;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
That looks like it imported, else the tables would not be there.
Locally, in terminal issue this command:
Code:
mysql -p -e "use sat1318107284790; select * from wp_options;" -Ns
Is there data returned?
Also, the db names you create on a new host do NOT have to be named as they are on GoDaddy servers, ie:
sat1318107320909 and sat1318107284790...
I suggest simpler names on new hosts, such as
piano-04
piano-03
so, your "Create database" statement would be something like
Code:
CREATE DATABASE piano-0n DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
where n is a number that represents one of your piano sites. The choice is up to you. It is merely a
recommendation.
Export from GoDaddy using the settings shown in 1.png attached.
Once saved locally, open the file and remove the lines near|on lines 22 and 23
Code:
CREATE DATABASE `sat1318107284790` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `sat1318107284790`;
They are NOT needed.
save the file. Note the location of the saved file.
create the db locally as root (mysql -p <enter>)
Code:
CREATE DATABASE piano-0n DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; exit;
locate the file downloaded to your machine from the GoDaddy phpMyAdmin interface. then your grant statement to allow php/www to connect (for wp-config.php...?)
Code:
grant all on db_name.* to 'wordpress'@'localhost' identified by 'password'; flush privileges; exit;
Now edit your wp-config.php for the credentials and dbname
Now you import it,
as root:
mysql -p dbname < /path/to/file.sql
check the data with
Code:
mysql -p -e "use dbname; select * from wp_options;" -Ns
Have another round
Cloned another VM and performed another test following that article mentioned before. The steps works but missing following steps;
1)
on local server
$ sudo mv /var/www/wordpress/wp-content /var/www/wordpress/wp-content.OLD
2)
start FileZilla on local server
copy Live site "wp-content", the complete folder, to local site /var/www/wordpress/
3)
Change the permalinks
Now the local site works same as Live site
The author suggests running "WordPress Database Backup". But I couldn't make it work.
Edit:
A further question.
Have you tried before copying several Live sites on the same server? It is possible creating several databases on ONE MySQL. What about WordPress? How to create several localhosts on same WordPress instead of installing several copies of WordPress on the same server.
[code]$ mysql -p -e "use sat1318107284790; select * from wp_options;" -Ns
Enter password:
Code:
ERROR 1045 (28000): Access denied for user 'satimis'@'localhost' (using password: YES)
My bad on that:
Over here, you had used sat1318107320909, so now try
Code:
$ mysql -uroot -p -e "use sat1318107320909; select * from wp_options;" -Ns
and
Code:
$ mysql -uroot -p -e "use sat1318107284790; select * from wp_options;" -Ns
One of those has your wp data.
Quote:
A further question.
Have you tried before copying several Live sites on the same server? It is possible creating several databases on ONE MySQL. What about WordPress? How to create several localhosts on same WordPress instead of installing several copies of WordPress on the same server.
Several copies of Wordpress one one host? sure can.
Several wp databases in one mysql environment? sure can.
Easier-to-remember what is what and where:
mkdir /var/www/piano3
mkdir /var/www/piano4
copy your GD Live site files using FileZilla to each of those directories.
Export each site into its own pianoN.sql file http://piano-03.satimis.com into piano3.sql http://piano-04.satimis.com into piano4.sql
as root:
Code:
mysql -uroot -p
CREATE DATABASE piano3 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE piano4 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Over here, I suggest simpler names for your dbs on the localhost, so that is what I'm using here.
Now grant the same user/pass but on those 2 dbs in mysql> using "mysql -uroot -p" (DO NOT CHANGE DBs)
Code:
grant all on piano3.* to 'wordpress'@'localhost' identified by 'password'; flush privileges;
grant all on piano4.* to 'wordpress'@'localhost' identified by 'password'; flush privileges; exit;
or quite possibly both at the same time using:
Code:
grant all on piano*.* to 'wordpress'@'localhost' identified by 'password'; flush privileges; exit;
Import (as root):
Code:
mysql -uroot -p piano3 < /path/to/piano3.sql
mysql -uroot -p piano4 < /path/to/piano4.sql
2 dbs and 2 sites.
edit each wp-config.php in each of those directories to point to the "correct" db and using the correct 'wordpress' user and their <password>)
when checking for success and code output using mysql -p -e "some command" -Ns, use
Code:
mysql -uroot -p -e "some command;" -Ns
instead.
Editorial note: All this work for what appears to be a stock install with no posts at http://piano-04.satimis.com/ ?
You could have installed a fresh wp instance and added the theme/plugins and be done with it by now.
but then what would you have learned?
A note about DBs:
The dbs can be named anything you want.
Paris, Madrid, SanFrancisco, or Mars, Venus, Earth, etc...
Just because GoDaddy exports your data as sat1318107320909 or sat1318107284790 you do NOT have to name your dbs that way when you move it/them.
P.S. I'm done helping here.
If I have to repeat these same instructions one more time, I'll go mad.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.