Linux - General This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
01-10-2014, 10:03 AM
|
#1
|
Senior Member
Registered: Apr 2003
Posts: 3,695
Rep:
|
Problem on copying Live WordPress site to local server
Hi all,
I was following;
Copy your WordPress site to a local server for development and testing
http://handcoded.ca/copy-your-wordpr...-local-server/
creating a copy of Live WordPress website on local server.
OS LinuxMint 16
LAMP
Ran "WP Migrate DB" to export Live WordPress
New address (URL) http://localhost/piano-04.satimis/
New file path /var/www/piano-04
Local copy of WordPress was installed on: /var/www/wordpress
wp-config.php
define('DB_NAME', 'sat1318107320909');
define('DB_USER', 'wordpress');
On browser ran:
1) http://localhost/wordpress/
Code:
Error establishing a database connection
2)
http://localhost/piano-04.satimis
Code:
Not Found
The requested URL /piano-04.satimis was not found on this server.
mysql> SHOW databases;
Code:
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sat1318107320909 |
| test |
| wordpress |
+--------------------+
mysql> USE sat1318107320909;
Code:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> SHOW tables;
Code:
+--------------------------------+
| Tables_in_sat1318107320909 |
+--------------------------------+
| wp_commentmeta |
| wp_comments |
| wp_links |
| wp_nextend_smartslider_layouts |
| wp_nextend_smartslider_sliders |
| wp_nextend_smartslider_slides |
| wp_nextend_smartslider_storage |
| wp_options |
| wp_postmeta |
| wp_posts |
| wp_term_relationships |
| wp_term_taxonomy |
| wp_terms |
| wp_usermeta |
| wp_users |
+--------------------------------+
mysql> select * from wp_options where option_id = '1';
Code:
+-----------+-------------+------------------------------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+------------------------------------+----------+
| 1 | siteurl | http://localhost/piano-04.satimis/ | yes |
+-----------+-------------+------------------------------------+----------+
1 row in set (0.00 sec)
What are following tables
Code:
wp_nextend_smartslider_layouts |
| wp_nextend_smartslider_sliders |
| wp_nextend_smartslider_slides |
| wp_nextend_smartslider_storage |
Please help. TIA
Rgds
satimis
|
|
|
01-10-2014, 10:09 AM
|
#2
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep: 
|
Last edited by Habitual; 01-10-2014 at 10:10 AM.
|
|
|
01-10-2014, 08:53 PM
|
#3
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,892
|
I don't know if this will help, but I do it in what I think is a much more straightforward way.
I just install Wordpress to a LAMPP stack on my local computer, export my remote database as an *.SQL file, and FTP down the remote database and all the files in my remote WordPress directory.
I put the files in place locally and create a MySQL root and user password (for the MySQL user, I duplicate the remote user and password--it's lazy, but it works, and if I get a bad guy plucking passwords off my local computer, I've got more security problems to worry about than my blog); as MySQL user, I import my database and I'm good to go for testing.
There are two references in the (I think) wp-options table that need to be changed from the remote domain name/IP address to localhost, or, every time to click a link, it will go to the remote site.
Two options in the local php.ini file need to be changed to allow import of the database because, by default, they are set at 8M; I currently have them set as 300M because my databaase has grown over the years. They are, if I remember correctly,
Code:
post_max_size = 300M
upload_max_filesize = 300M
I just did this over the holidays because I decided to change the theme for my blog and wanted to configure and test it locally before I put it in place.
Last edited by frankbell; 01-10-2014 at 09:05 PM.
|
|
|
01-11-2014, 03:11 AM
|
#4
|
Senior Member
Registered: Apr 2003
Posts: 3,695
Original Poster
Rep:
|
Quote:
Originally Posted by frankbell
-snip-
I just install Wordpress to a LAMPP stack on my local computer, export my remote database as an *.SQL file, and FTP down the remote database and all the files in my remote WordPress directory.
I put the files in place locally and create a MySQL root and user password
|
I already did those steps. MySQL root already created with password at its installation.
Quote:
I import my database and I'm good to go for testing.
|
I already did this step
Quote:
There are two references in the (I think) wp-options table that need to be changed from the remote domain name/IP address to localhost, or, every time to click a link, it will go to the remote site.
Two options in the local php.ini file need to be changed to allow import of the database because, by default, they are set at 8M; I currently have them set as 300M because my databaase has grown over the years. They are, if I remember correctly,
-snip -
|
According to the article which I was following I created follows Also according to the article mentioned above I download the complete website on local server
$ ls /var/www/
Code:
index.html info.php piano-04 wordpress
folder wordpress is local WordPress
folder piano-04 is the Live WordPress
$ ls /var/www/piano-04/
Code:
index.php wp-blog-header.php wp-cron.php wp-mail.php
license.txt wp-comments-post.php wp-includes wp-settings.php
readme.html wp-config.php wp-links-opml.php wp-signup.php
wp-activate.php wp-config-sample.php wp-load.php wp-trackback.php
wp-admin wp-content wp-login.php xmlrpc.php
/var/www/wordpress/wp-config.php
Code:
....
define('DB_NAME', 'sat1318107320909');
/** MySQL database username */
define('DB_USER', 'wordpress');
....
/var/www/piano-04/wp-config.php
Code:
...
define('DB_NAME', 'sat1318107320909');
/** MySQL database username */
define('DB_USER', 'sat1318107320909');
....
Please advise which file shall I change? and How?
Thanks
satimis
Last edited by satimis; 01-12-2014 at 03:17 AM.
|
|
|
01-11-2014, 08:20 PM
|
#5
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,892
|
I'm sorry, I did not read your post clearly. Thanks for giving me another shot.
Going back to your orginal question, many plugins create their own tables in the WP database.
If you import your database in a different location, the tables will be present, even it the plugin is not. I think Habitual answer the question as to where the "nextend" tables came from in post number two.
Generally, I just leave plugin tables in place, even if I no longer use the plugin--they won't do any harm--they will just lie there--and, if I try to remove them, not being a WordPress database expert, I might.
Unfortunately, I'm not quite clear what you are asking about here:
Quote:
Please advise which file shall I change? and How?
|
If it's where to change the domain name to local host in the database, look in the "wp_options" table in your database for the entries "blogname" and "home."
If I have missed the point (again), please straighten me out.
|
|
|
01-11-2014, 09:00 PM
|
#6
|
Senior Member
Registered: Apr 2003
Posts: 3,695
Original Poster
Rep:
|
Quote:
Originally Posted by frankbell
- snip -
Unfortunately, I'm not quite clear what you are asking about here:
|
Oh sorry I missed something on my last posting. Just corrected them.
There are 2 'wp-config.php' files.
1)
/var/www/piano-04/wp-config.php
2)
/var/www/wordpress/wp-config.php
Which file shall I make correction? and How?
Quote:
If it's where to change the domain name to local host in the database, look in the "wp_options" table in your database for the entries "blogname" and "home."
|
mysql> USE sat1318107320909
mysql> select * from wp_options where option_name = 'blogname';
Code:
+-----------+-------------+--------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+--------------+----------+
| 2 | blogname | Piano-04 | yes |
+-----------+-------------+--------------+----------+
1 row in set (0.00 sec)
mysql> select * from wp_options where option_name = 'home';
Code:
+-----------+-------------+------------------------------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+------------------------------------+----------+
| 36 | home | http://localhost/piano-04.satimis/ | yes |
+-----------+-------------+------------------------------------+----------+
1 row in set (0.00 sec)
Other advice noted. Thanks
satimis
|
|
|
01-11-2014, 09:07 PM
|
#7
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,892
|
I expect it would be the one in your actual WordPress root directory, the same on in which your index.php resides. I don't have two wp-config.php files on my little site.
You could test like this: change the name of one to something like something like wp-config.php.bak and test. Then do the same to the other one. Whichever one breaks WordPress when it is changed is the one that WordPress is using; then change the name back.
I'd like to know what you find out, especially if WP is somehow using both of them.
|
|
|
01-12-2014, 05:00 AM
|
#8
|
Senior Member
Registered: Apr 2003
Posts: 3,695
Original Poster
Rep:
|
Quote:
Originally Posted by frankbell
I expect it would be the one in your actual WordPress root directory, the same on in which your index.php resides. I don't have two wp-config.php files on my little site.
You could test like this: change the name of one to something like something like wp-config.php.bak and test. Then do the same to the other one. Whichever one breaks WordPress when it is changed is the one that WordPress is using; then change the name back.
I'd like to know what you find out, especially if WP is somehow using both of them.
|
Hi,
After completing Step 5 and 6 then it works by browsing;
Code:
http://localhost/wordpress/
Code:
http://localhost/piano-04.satimis
doesn't work
Besides the steps are not so straight forwards. And I don't understand WHY it needs 2 WordPress;
/var/www/piano-04
/var/www/wordpress
/var/www/piano-04/wp-config.php
Code:
define('DB_NAME', 'sat1318107320909');
define('DB_USER', 'sat1318107320909');
Remark:
Also tried
Code:
define('DB_USER', 'root');
/var/www/wordpress/wp-config.php
Code:
define('DB_NAME', 'sat1318107320909');
define('DB_USER', 'root');
The steps on following article are more straight forwards;
How to Clone Your Live WordPress Blog to a Local Server
http://www.maketecheasier.com/clone-...-local-server/
satimis
Last edited by satimis; 01-12-2014 at 05:03 AM.
|
|
|
01-12-2014, 08:47 PM
|
#9
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,892
|
Quote:
Besides the steps are not so straight forwards. And I don't understand WHY it needs 2 WordPress;
/var/www/piano-04
/var/www/wordpress
|
I can't come up with any ideas; when I do local testing, I use XAMPP and everything goes into the htdocs directory. Hopefully someone who knows a lot more than I will jump in to help us.
Maybe it might be worth looking at your http.conf file. Maybe it will tell us something about why you have two directories.
Last edited by frankbell; 01-12-2014 at 08:49 PM.
|
|
|
01-12-2014, 09:14 PM
|
#10
|
Senior Member
Registered: Apr 2003
Posts: 3,695
Original Poster
Rep:
|
Quote:
Originally Posted by frankbell
I can't come up with any ideas; when I do local testing, I use XAMPP and everything goes into the htdocs directory.
|
On LAMP, everything goes to /var/www/
Quote:
Maybe it might be worth looking at your http.conf file. Maybe it will tell us something about why you have two directories.
|
I just followed that article. The only difference is that I install the local copy of WordPress first before importing the DB.
I'll start another test following that article step-by-step to check what will happen. It is quite easy for me to run new test because I'm running virturalization here. The only difference will be running LAMP here instead of MAMP.
satimis
|
|
|
01-13-2014, 05:02 AM
|
#11
|
Senior Member
Registered: Apr 2003
Posts: 3,695
Original Poster
Rep:
|
Hi all,
Just finished another round. The steps on the article mentioned above are working but it needs a little bid thinking:-
1. It works on MAMP and I work on LAMP
2. I work on the latest version of all software. The article has been created sometimes before. Therefore slight change on steps is necessary.
3. Change on permalinks is essential otherwise the local site unable to work properly
I found following problem;
on local site:
see Screenshot_local_server.png
on Live site
see Screenshot_live_site.png
Youtube Gallery plugin is running on both sites. I'm still hunting around for the cause.
satimis
|
|
|
01-13-2014, 10:38 AM
|
#12
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep: 
|
The issue appears to be missing files for the Piano Solo Album on the localhost.
Do they "play" when clicked?
|
|
|
01-13-2014, 09:22 PM
|
#13
|
Senior Member
Registered: Apr 2003
Posts: 3,695
Original Poster
Rep:
|
Quote:
Originally Posted by Habitual
The issue appears to be missing files for the Piano Solo Album on the localhost.
|
NO. They are linked to Youtube, no files download.
Quote:
Do they "play" when clicked?
|
YES. The copied website on local PC works exactly as the Live. I suspected the problem coming from Youtube unable to detect the local site. I have tried removing all links ( http://youtube.file.url) and re-edited those deleted links. Youtube asked for hostname and FTP url. I have no idea what did FTP url refer to?
satimis
|
|
|
01-14-2014, 10:03 AM
|
#14
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep: 
|
I have no idea either, sorry.
|
|
|
All times are GMT -5. The time now is 04:53 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|