LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 01-10-2014, 10:03 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
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
 
Old 01-10-2014, 10:09 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
http://wordpress.org/plugins/nextend-facebook-connect/

Nextend Facebook Connect plugin.

for the connect issue.... re-read
https://www.linuxquestions.org/quest...ml#post5094354

Last edited by Habitual; 01-10-2014 at 10:10 AM.
 
Old 01-10-2014, 08:53 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,321
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
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.
 
Old 01-11-2014, 03:11 AM   #4
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by frankbell View Post
-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
Code:
New address (URL)	http://localhost/piano-04.satimis/
New file path		/var/www/piano-04
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.
 
Old 01-11-2014, 08:20 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,321
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
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.
 
Old 01-11-2014, 09:00 PM   #6
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by frankbell View Post
- 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
 
Old 01-11-2014, 09:07 PM   #7
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,321
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
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.
 
Old 01-12-2014, 05:00 AM   #8
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by frankbell View Post
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.
 
Old 01-12-2014, 08:47 PM   #9
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,321
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
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.
 
Old 01-12-2014, 09:14 PM   #10
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by frankbell View Post
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
 
Old 01-13-2014, 05:02 AM   #11
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
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
Attached Thumbnails
Click image for larger version

Name:	Screenshot_local_server.png
Views:	11
Size:	79.4 KB
ID:	14481   Click image for larger version

Name:	Screenshot_live_site.jpg
Views:	11
Size:	54.8 KB
ID:	14482  
 
Old 01-13-2014, 10:38 AM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
The issue appears to be missing files for the Piano Solo Album on the localhost.
Do they "play" when clicked?
 
Old 01-13-2014, 09:22 PM   #13
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by Habitual View Post
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
 
Old 01-14-2014, 10:03 AM   #14
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
I have no idea either, sorry.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgrade & secure old wordpress site pingu Linux - Security 4 09-15-2013 09:24 PM
Can't export wordpress site harry_ord Programming 1 07-12-2013 03:27 PM
ubuntu LAMP server, can't access site remotely, locally works by local ip and wan weylin Linux - Newbie 8 04-25-2012 06:37 AM
mirroring my local master server contents to another server located at remote site raasips Linux - Newbie 3 02-04-2010 07:41 PM
copying files from another server and printing it in local notepads Prasun1 Linux - General 1 09-20-2005 03:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration