Copying a Wordpress Site to a Subdomain - wordpress

I am copying my site The Sydney Visitor to the subdomain new.thesydneyvisitor.com. The reason is that i want to change the design while my old site is still active.
What I have done so far:
Copied all the files to the sub-domain directory using ftp.
Created a new database
Exported the old site database and imported it to the new database
Edited the wp-config file (in the subdomain directory) to point to the new database
Updated the wp-options table to reflect the url change
Run this query to update the URL change in the posts
UPDATE wp_posts SET guid = replace(guid,'http://www.thesydneyvisitor.com','http://www.new.thesydneyvisitor.com');
The problem:
After doing all these when I try accessing the site using the subdomain url I get the following errors:
Warning: require(/home/rapidtem/public_html/new/wp-includes/load.php) [function.require]: failed to open stream: No such file or directory in /home/rapidtem/public_html/new/wp-settings.php on line 21
Fatal error: require() [function.require]: Failed opening required '/home/rapidtem/public_html/new/wp-includes/load.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/rapidtem/public_html/new/wp-settings.php on line 21
Kindly assist. I am stuck.
Thanks in advance

Double check the following things.
Properly configured the sub-domain directory.
Copied all the wordpress files to the new directory. (I prefer zip the wordpress folder and upload to the new place to avoid any file loss)
Correct database names given in wp-config.php
The new directory has the read/write permissions (Check is it a password protected folder or not)
If everything above is fine, then the problem will be in your new database.
Instead of running a query to update the URL change in the posts do the following steps:
Goto wp-options table and edit the site_url ( at 1st row), home (around 39th row ) and upload_path ( atround 58th row).
Here is a detailed tutorial How to move wordpress to a new server or host.
There are some plugin available to do these search and replace in database. Check this one

Have you checked the referenced files exist in those locations?

Did you change the Home and Site URL from the Wordpress Database?

Related

Migrating Wordpress site to new domain

I have a Wordpress site with hostagator web hosting , I am buying new domain and want to use new domain for site but same existing developed site. How to backup existing site and then restore to new domain ?
Solution is here
after searching a lot i got one simple solution.
Using Duplicator plugins or any other tool is either difficult or paid.
My simple solution is as follows
Backup and download all data from public html folder
Download the SQL database associated with the wordpress site.(in phpMyadmin you will find option of export database.)
Now upload the same files of public html folder to the public html folder of new hosting.
create a database with same name and import the tables from the downloaded SQL database.(in phpMyadmin you will find option of import.)
Now check the site if the domain is not changed
If you are changing domain name too by keeping the website same you need to follow few more steps
Download and place the interconnet/it tool in public html folder and follow the steps in documentation to use this tool.
case1- you are transferring site from one domain to another
if you are transferring from abc.com to xyz.com ins search and replace tool replace abc.com string with xyz.com .
case2- if you are changing the names only in website
if you are keeping the domain same but changing name of site e.g. ABC Technologies to XYZ technologies . Then replace ABC to XYZ
You can use this tool as per your need as it is applicable for database too.
There are a lot of ways of doing that. You can search a lot of materials on Internet but I would advise you to use this tool because I used in the past and it's reliable and very straightforward.
It is called Duplicator and is a wordpress plugin solution:
https://wordpress.org/plugins/duplicator/
Consider to maintain your site active until your new site is working properly. I hope I could help you. Regards.
Just install WP migrate db plug-in in your current website. And export the database with your new URL. Then create a new database in your server and import the updated SQL file. Then edit your config.php with new database details. Finally point your new domian to this server
**should take complete backup (both files and databse) before making the above changes **
Here I will explain how to take back up manually and restore manually on another server with other domain name.
Backup: You need to take back up of site and database.
For site, you can take only back up of wp-content. It contains all data you need to resore.
STEP1 : cpanel-file manager-public html- (wp-content)- compress & save- export or
download zip file.
For database: phpmyadmin -> export databse. This gives you localhost.sql file.
These two files one .zip file and another .sql file are your back up.
(It is good to remember user id password of wordpress dashboard of this one)
Restore in another server on another domain:
After you get you new domain dns propagated on new server, open its cpanel.
Run wordpress script , see database name it is creating.
1) database restore:
MyphpAdmin->Database created by wordpress->check all tables->drop all tables.
Now your database is clean without any table.
In your loacalhost.sql file remove two piece of codes:
a)any signature like this (it should be on top)
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
-- Host: localhost:3306
-- Generation Time: Oct 14, 2019 at 09:45 PM
-- Server version: 5.6.45
-- PHP Version: 7.2.7
b) Code prompting creating a new database like this:
-- Database: soniasin_fitfoody
CREATE DATABASE IF NOT EXISTS soniasin_fitfoody DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE soniasin_fitfoody;
-->Now, go to import and import, select your back up .sql file-> go. It will import all tables in your this database.
--> There is a database table now like wp_option, go there & edit siteurl (keep your new domain name), home (keep your new domain name) and admin email id.Very important.
Site Restoration:
1) Go to public html folder. Remove directory wp-content.
2) Import your back .zip file here and unzip.
3) You will find on wp-config.php file in public html folder, open it and update table prefix.
$table_prefix = 'wp_'; Here yo have to see what is your table prefix. Check database tables and see what prefix is in all tables. Here in this example it was 'wp_' , therefore kept it.
4) Now log in to you wordpress dashboard. It will take username of old site now and should take old password too. In case you forget password, change it and then open. Now wordpress will confirm that your database is changed, say ok and proceed.
Your site should be running on new URL now on another server.
In case of doubt, you ask me. If one want to watch any video here goes the link https://youtu.be/wROa37k_RQA.

Running wordpress site different local host

I have recently taken my first programming project and it is with word press, I have never used it before as I have only done hard coding HTML/CSS before. My client has given me all of the files of her site, how do I run this on wordpress. I have installed wordpress and can run the test123 site but when I do the same thing on the local server with the info she gave me then I get a "Error establishing a database connection". This is surprising because all of the file folders in the info she gave me is the same as the test site (obv the content is different). She was doing it on a mac and I am on windows but I assume that hsouldn't matter. How can I fix this so I can see the site on wordpress and make the required changes that she wanted.
Thanks!
I tried changing the config file but that just gives me the setup again and not the site she has already made :(
First, create a folder into your htdocs folder with name test123
now put all the directory which one provide you by client in to test123 folder like wp-admin , wp-content ....etc
after then in new tab run this path
http://localhost/phpmyadmin/
Create a database with name something test , then import the database which one provide to you by your client , after import go to table name wp-options and change the site url http://localhost/test123 same for admin URL
Now back to your files and open wp-config.php file from your test123 folder root directory , change database name which one you recently created "test"
username set to "root" and password "blank" hostname should be "localhost"
now run path in to URL http://localhost/test123
after this if you want to login http://localhost/test123/wp-admin
then first you need to change user password with md5 strings from database wp-user table
the site will work on localhost
Here some change for wordpress project on host to other host .
in your sql file change host name example
to change
http://localhost
after change to your config file details.
installation WordPress in wamp server
first, start wamp server
click to start all services when it will work the icon will be colored green
Go to C:\wamp\www and paste WordPress folder there. You can rename the WordPress folder to anything you want for example test123
Now open a web browser and go to:
http://localhost/test123/
it will ask you for database connection error
now open the phpmyadmin as showing into create
a database and import the database
then go to you Wordpress folder test123 and find the wp-config.php file and replace your username with "root" database name you created , and password blank . now run http://localhost/test123/ once again
if not work then please come to chat box room.

In wordpress generated Fxc393QU.html file

In my wordpress site suddenly generated unknown file which name is Fxc393QU.html in that file only content Fxc393QU. I'm sure this is generated by any script.
I dont know how this happen but due to this query string URL no longer work.
One more thing is this file owner and group is root root
nobody create file without sudo command.
Is my worpdress site hacked ?
Please scan your site using this plugin: https://wordpress.org/plugins/wordfence/

Drupal Commerce Kickstart - Making Test site of Live site

I want to do developments on my client's website but by making a clone of it. So, main website url is: http://website.com and the clone i am trying to create is: http://test.website.com.
So far i've done the following:
copied entire root directory into public_html/test dir (with folders config,field,FirePHPCore,fontyourface,includes,js,misc,modules,scripts,sites,styles and themes)
created a subdomain in cPanel for test.website.com
checked the file settings.php (inside sites/default folder) for $base_url but found it commented, so left it as it is unchanged.
copied db via phpMyAdmin and updated the new db details in settings.php (inside sites/default folder).
inside the table variable, two rows with the name securepages_basepath and securepages_basepath_ssl. Changed their values from http://website.com to http://test.website.com (using the variable_get and variable_set functions).
Now i can access http://test.website.com but when i click on login (from header) it takes me to http://website.com/user and if manually type http://test.website.com/user and login then it takes me to http://website.com/users/admin then i have to manually type in correct address http://test.website.com/users/admin.
And when i logout, it again takes me back to http://website.com.
So i want to know how can i completely make it to work on http://test.website.com?
Are there more variables to change?
And how i can make 100% sure that the test site is only using test and not the live site. I am afraid of messing up live website.
Please advice, thanks!
I fixed it by disabling the secure pages from inside the mysql database. It was inside variable table and securepages_enable field. It was in blob so i had to download the blob first and opened it in notepad and changed the value inside it from 1 to 0 and then uploaded it back by updating the securepages_enable field.
I had to do this because after logging in from my test url, the urls were redirecting back to the live website, so whatever change i was making, it was all affecting the live site.
Hope this helps to someone with similar case. Thanks!

Cant Upload, Update, Install Plugins After cloning wordpress with backupbuddy

I've just migrated a client site to her production server using the latest version of BackupBuddy v3.0.40, and at first glance everything looks dandy, but on closer inspection, most WP file functions are borked: update wp, upload images, upload plugin.
I've done this a ton of times (several times on this host), and don't know why its not working here
I suspect it has to do with the tmp directory, but i can't see a problem..
another possibility is that a script (installatron via cpanel maybe interfering.. i notice that there are upload folders created for all months up to 2016! i read about this being a solution to permissions issues in WP's past)
This is what I've tried:
changing the wp-media upload location to the default, changing the 'store in year/month' setting and general wiggling. this was imported as '/home/###/public_html/wp-content/uploads' which looks correct, but unnecessary, the default is wp-content/uploads. neither work.
changing the permissions on wp-content and uploads dir to 777 (not all contents)
adding a line to wp-config.php:
define('WP_TEMP_DIR', ABSPATH . 'wp-content/'); no dice
uninstalled all traces of the installatron scripted wp installation (no files or db remain)
repeating the migration (same backup file, identical results)
confirming that:
i can create new posts, just not upload media
it works on the staging server (same host)
safe mode is off
apache is running as user, tx suPHP
the files were extracted by php via the browser
i've compared phpinfo to other working sites and dont notice anything out of the ordinary
hope you can shed some light!
thanks, Tim
image upload error:
“envelope-9887.jpg” has failed to upload due to an error
The uploaded file could not be moved to /home/###/public_html/wp-content/uploads/2012/07.
wordpress update error:
Download failed.: Destination directory for file streaming does not exist or is not writable.
plugin install error:
Download failed. Destination directory for file streaming does not exist or is not writable
sometimes when migrating you may have to look through the database options table and change a few entires, ie:
from the old site structure it could be: /home/yoursiteid/public_html/wp-content/ etc..
but on the new server the structure could have changed?
ie: /home/differentuserid/wwwroot/wp-content/
edit a file on the server to include :
echo getcwd() . "\n";
just to see if the home directory is the same as your current server or if its changed from your old sevrer, have a check in your database options table and update the entires which ref the old dir structure..
I found, eventually, that I'd overlook the line
define('WP_TEMP_DIR', 'old-hard-link-here');
which I believe was nestled directly under the wp salts, camoflaged to the tired eye! Simply removing that line and setting the media path to the default fixed the issue.
I believe that that line was installed by the cPanel script 'Installatron'.
Case closed

Resources