problem mooving woocommerce to another domain - wordpress

I have a woocommerce website installed and work normally , I want to change the theme without make changes on the website so all still ( products , pages, ...etc) .
I want to copy the same website into another domain to do changes without stop my first website .
this what i have do :
1- copy all files from the old to new website.
2- import database frm the old .
3- past into the new domain all files
4- import the tables of the old database to the new database
5- change the wp-config to work with the new database
6- change the domain into table : wp_options
and i launch the new domain : the first page is ok without errors
but when i enter to preview product i have error that page dosen't exist , and all other pages the same error . can any one help me ??? any ideas ?

When moving a WordPress site a few things to make it easier.
Manually, zip up uploads/plugins/theme or if you have some crazy thing going on wp-content. Generally, nothing else needs to be moved. (this excludes things like robots.txt etc you may have to move)
After importing the DB you need to run a search and replace to swap out the domain. It is used in more places than you think.
Go to settings and re-save permalinks twice. - This fixes most issues with pages not loading/404.
There are plugins out there that make this easier.
Updraft - Don't need the paid version. Can setup new site then add files and import them.
All in One WP Migration - Haven't seen anything this doesn't move but can be slow and harder with large sites.

Plugins like All in One WP Migration or Duplicator can be helpful, but from time to time they may fail.
With AIOWM you must create a backup and a blank WP installation, install the plugin in this blank installation and import the backup. Beware that many features are paid.
With Duplicator you create a backup and an installer that you've to upload (via FTP) to the new host and there execute the installer.php script to recover the backup.
Both of them take care of the search&replace needs.
If you want to go manual, you have to copy all files via ftp, or if you've a Cpanel or similar you can upload a Zip file and then extract it via the panel (I guess you don't have the ssh access to the server).
Than you've to create a database dump via PhpMyAdmin and restore it in the new server, thank you've to change two option in the database: the site url, and the wordpress address url.
That should let you login to the website backend, but BEWARE you've to do the search and replace on your database.
To do so, easyly, you can use Better Search & Replace plugin (https://it.wordpress.org/plugins/better-search-replace/).
Guessing that http://old_domain.com is your old domain and https://new_domain.com is the new one, usually I go this way on S&R:
- Search for "old_domain.com" and replace with "new_domain.com"
- Search for "http://new_domain.com" and replace with "https://new_domain.com" if you have an active SSL certificate
Than go to Settings -> Permalink and save twice.
Everything should be fine now :)
Remember to clean every cache if you've one active.

Related

Wordpress wants to install itself, rather than run the blog

We have created a duplicate of our website on a new server as part of a migration. We have a wordpress blog that is part of our website.
The docroot of the wordpress site is set as an alias in our main site. The result is that to access the site home page, the following url is used: https://www.rephunter.net/blog/.
The new environment is not available to the public at this time, and is only accessible within our VPN. When the above link to the blog is followed, instead of the expected home page of our blog, we get the page at https://www.rephunter.net/blog/wp-admin/install.php, which wants to install a new site.
The configuration in the new environment is supposedly an exact copy of our production site from some time back. The permissions on the main files is the same.
What is it that is causing the attempted blog access to be redirected to the installation script?
EDIT:
The responses so far have not really absorbed the intent of the previous information. We are not migrating in the normal sense. Rather we are testing in a new virtual environment that will eventually lead to a more normal migration.
We have an exact duplicate of our original wordpress and database environment that is running in a virtual environment with an updated protocol stack that is only accessible if you are on the VPN for that environment. As far as we can tell, there is no difference in the configuration.
For example, the parameters in wp-config.php are exactly the same as in the original installation. When php runs, it sees the same environment, with host names and everything identical. It would not work otherwise.
Yet if there really were no difference, it would just run. But since WP is trying to install a new database, there is something different that we are missing.
To further illustrate this: supposed you took an image backup of the wordpress installation and the database, and put it in a different VM, and set up the DNS and everything as it needs to be--the new environment looks no different than the old one. All databases, wp-config settings, etc, are the same. So our main website and database functions very similarly.
As I mentioned above, the difference in the protocol stack should be considered. The old system is on PHP 5.6.27--the new one is on 7.3.4. So that could be causing some difference, which maybe somebody might recognize. Wordpress is 5.2.2 and should be compatible with both PHP levels.
We believe there is some relatively simple parameter setting that we are missing. For example, as in the first answer that $table_prefix is set wrongly. But that is not it in this case.
WordPress redirects you to that installation screen because the database it's connecting to is working (meaning, the username and password are correct), but the data it's expecting to be there isn't. Therefore, it assumes it's a new / empty database and prompts you to install WordPress.
I've seen this happen in two scenarios:
The database really is empty, and thus WP needs to install the standard tables and info
The table prefix in your wp-config.php file is incorrect for an existing database
Look at your wp-config.php file in the root directory of WordPress, and look for a line similar to this:
$table_prefix = 'wp_';
Then, open up the database (phpMyAdmin or some other interface to browse what the database structure actually is) and confirm that the table prefixes (the first few characters of the table names) actually match what's set above.
Hopefully this gives you something to go on! Let us know what you find
Migrating Wordpress websites can be quite tricky. I've worked as a WP developer for a number of years and always struggled with manually migrating websites.
There are a number of factors to consider:
WP stores a lot of installation specific information within the database. So you can't do a database dump and upload the export into a new database.
Changing the website url within the wp_options table in the databased there are still other references to the original url scattered throughout the db.
You could try a find and replace all using an editor that supports this sort of functionality (vscode, sublime, atom) but things always end up breaking and your doing tons of "find & replace" actions.
I have always relied on a 3rd party tool Backup Buddy as it simplifies the entire backup and migration process and offers the peace of mind of having easily deployable backups for your website.
Backup Buddy allows you to export your website as a zip and then you can move the zip to any server you want and the plugin provides an installer script (php) to guide you through the migration of your wp site to any host and database of your choosing.
Note: I am not in any way affiliated with iThemes or Backup buddy, and I do not stand to benefit in anyway if you decide to use the plugin. This is only advice on a tool that I have found helpful, reliable, have had success with, and currently actively use on a number of websites that I maintain.
WordPress display installation page because you have not update your wp-config.php file after migrating server so please follow below steps in future when you migrate your website.
Please follow this steps when you migrate your WordPress website from one server to another server.
Back up your website files/database
Export wordpress database.
Create database on your new host server.
Edit the wp-config.php File and edit this details.
Add new database name
Add new database username
Add new database user Password
Add new host as per your hosting provider or (localhost is default)
Import your database to new server.
upload the WordPress files to your new host
defining new domain URL & Search/Replace old domain URL

wordpress website transfer from one machine to another

I installed wamp and wordpress locally. My friend also installed wamp and wordpress locally and started working on a website. I want him to send me what he finished so I can continue working on it. So he sent me his www folder inside wamp installation folder and I paste it inside my www folder. But when I open the website in browser it is empty (default one with Hello word). What should he send me, so I can continue working on the website?
If it's a wordpress website, it's not as easy as copy-paste; but it's not too difficult.
After they have given you all the physical files, your friend should
1) export their database (the name starts with wp_) using phpMyAdmin, and you should
2) import it with phpMyAdmin [note: if you want to overwrite your wordpress database, do this: 2a) as a backup, export your database with phpMyAdmin; and 2b) select all tables in your database and 'drop' them. Now the database is empty and you can import your friend's inside it.]
When this is done, you should
3) use phpMyAdmin to edit the first two entries in the table wp_options, inserting the proper path to your local website; then you should
4) assign to this database the username-password combination present in the wp-config.php file, in the main folder of wordpress. You do this with phpMyAdmin. Alternatively, you can edit wp-config.php so that it carries the proper password-username combination for your system.
IF there is nothing of interest in your friend's database (as posts, pages, themes or plugins settings that you need etc) then you can skip steps 1,2 and 3.
This should do it. :)
The content of your WordPress installation is stored in a mySQL database, not on the file system. The files your friend sent you is WordPress itself and doesn't change anything contentwise.
Your friend needs to export (dump) his database to a SQL file. This can be done with a tool like PhpMyAdmin or mySQL Workbench. Take this file and import (overwrite) your local database with it. Better make a backup of your database before!

moving WordPress over to domain, after working on it locally through MAMP

I've finished the styling changes on WordPress and I'm ready to move it from MAMP to my domain.
Will this involve any changes to the WordPress files or can I just drag it over to my new domain once I purchased it?
The main start you must make is update your wp-config.php
define('WP_HOME','http://www.mynewdomain.com');
define('WP_SITEURL','http://www.mynewdomain.com');
That way wordpress knows what domain it MUST run from.
The reason you do that is because without this you may not be able to access admin, login, etc etc.
When this is working and you have logged in, go to wp-admin and go to your permalink settings.
Make a NOTE of your settings, then change them to default (and woocommerce settings etc).
Go to your home page and a few others, and notice how messed up your urls look :)
Now go back to permalink settings and restore them (the point of this is to make sure your .htaccess file that wordpress depends upon is set correctly)
Finally, have a look at https://github.com/veloper/WordPress-Domain-Changer to change your sql etc if needed.
note this method is very handy for developers so you just update your wp-config.php for localhost or development or production (not for testing purposes, don't use your local pc. copy it all up to a subdirectory of your hosting partner e.g. http://www.mynewdomain.com/mytestarea. Make sure you use a COPY of the mysql database (never point both to the same database). You now can test on the hosting platform without disturbing the live site or your development causing issues to other people.
It's been a long while for me personally, but you'll want to change the SiteURL via the options menu in wp-admin.
Otherwise, just make sure your MySQL database is exported over, your credentials and user permissions are all setup and those work too.
If you still have problems:
https://codex.wordpress.org/Changing_The_Site_URL
https://codex.wordpress.org/Moving_WordPress
The database has to be updated. What always works for me is that I export the database from phpMyAdmin or MySQL (using mysqldump) and open the exported .sql-file with a text editor, like Sublime Text.
Now you want to find any occurence of your previous URL. Let's say on your dev machine the URL to the index of your Wordpress site is http://localhost:8080/wordpress and you want it to be on a website under https://domain.com you simply do a Find & Replace using that and replace everything with https://domain.com.
For older Wordpress versions you have to update the .htaccess files if you have custom URL's.
You have to make a search replace in your database and replace your local domain ( test.lo ) with the live domain ( test.com ).
To do this you can use the script from here: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Add the searchreplacedb2.php file in your route folder and the access test.lo/searchreplacedb2.php and follow the steps there. This will replace your local domain with your live one everywhere in the database.
You can't make a simple search-replace because the local domain might be serialized in some fields in the database, and a simple search-replace will not replace those.

Wordpress pages won't load after hosting transfer

I've just transfered a wordpress website to another domain.
For the transfer I've made the following steps:
Copied db and changed domainnames (http://olddomain.com to http://newdomain.com)
Imported db on new host (via phpMyadmin)
Changed wp-config to match new db settings
uploaded all wp files
So the homepage works, but I can't visit the other pages. However, they are showing up in my admin page.
The way I've done this in the past and have worked for me:
1- Export db from phpMyAdmin, then replace in the .sql file all references to old domain.
2- Imported db on new host (via phpMyadmin)
3- Changed wp-config to match new db settings
4- Uploaded all wp files
5- Regenerate .htaccess file, if you are using permalinks.
(you can do this the way #Riboflavin suggests)
Also, here you can find some additional information that could help:
http://codex.wordpress.org/Changing_The_Site_URL
If you are using permalinks you will need to regenrate them after the transfer. Go to Settings → Permalinks in your admin panel and choose the permalink option you would like to use and click Save Changes. This will regenerate the permalink portion of your .htaccess file for your new domain.
Are the links to those other pages still pointing to the old domain?
If so, you could try the Velvet Blues Update URLs plugin to update all the links in your site.
I've used this successfully in the past, but recommend that you back up your data fully before trying it yourself.
The fastest transfer from my experience is through cpanel using fantastico or something that installs wordpress quickly. The process is as following:
Install wordpress on new hosting through fantastico or similar app
Delete everything in installed directory except for wp-config
Copy everything from old wordpress data, except for wp-config
Paste/transfer all that data to the new host
Now export old database and delete tables on the new one then import from old db
Change site URL within database to new one
Using fantastico helps in setting up databases quickly and wp-config. No need to do it manually and waste time. Just make sure to leave the installed one and not transfer the old one.
The whole process takes me like 2-3 minutes, I think its the fastest once you get it.
You need just to adjust your new .htaccess by regenerating it
go to WordPress dashboard
Settings > permalinks
then save modifications
if it's work then well done else you need to manually change it :
you will find the .htaccess content after saving modification in permalinks page copy the contents and create the .htaccess file in the root directory

Moving Wordpress with Headway to a new domain breaks the site

I have a client's wordpress site that is built using Wordpress and Headway. I need to move it to a new domain on a new shared server ( same host provider with the same hardware configuration ).
I've moved many wordpress setups like this before, including Wordpress / Headway combos. I've also, during debug, used Headway's documentation and videos to double check that I'm doing everything correctly.
I moved the database over and replaced all occurrences of the old domain with the new domain, and updated all filepaths. Then I copied the public_html folder to the new server. The site should be working at this point.
Instead I get the Headway error message No Content to Display on an otherwise empty html page. I've traced the problem to the wp-config table where Headway stores serialized data for it's blocks. I can update data throughout the database to the new domain everywhere except in these Headway entries in the wp-config table. As soon as I update those, the site starts to fall apart all over the place, and if I update them all, the site loads the Headway error message No Content to Display. The underlying Wordpress system seems to still be working as I can load the /wp-admin console and all my content exists and looks correct.
If I trace the problem deeper, it appears that the Wordpress function get_options() is failing in the Headway file data-layout-options.php. I have been unable to debug any further.
The site works perfectly on the original domain, and, in theory, I'm doing a direct copy of all data and then simply replacing the old domain with the new domain.
Can anyone help with a similar problem? It feels like I'm chasing a bug in the code when really it's some sort of simple oversight or config setting that has been munged. Please help!!!
I was indeed close to the problem.
The serialized Headway data in the Wordpress wp-config table contains string lengths. Migrating the database oneself, and then grepping and replacing the old domain with the new domain and old web folder file path with the new web folder file path causes unserialization to fail in the Wordpress system ( eg. the get_options() Wordpress function ).
Instead of writing a custom script to deal with the string lengths, I tested a few database migration plugins. WP Migrate DB was the winner and solved the problem.
Migrating the Database
Install the plugin on the original domain ( original Wordpress install ). It will ask you to input the new domain and the new file path of your web directory ( the web directory file path is very important as well ). In my case, for example, the file path of the web directory had changed from /home2/old_username to /home6/new_username.
The plugin will then dump the entire Wordpress Database and replace all occurances of the old domain and old file path with the new domain and file path of the web directory. The .sql dump will then save locally on your computer.
This was not perfect however, and I still needed to do a few of my own grep and replaces. Additionally, I had to be careful about this because a few of the ones that were missed were in the Headway serialized data and I had to do MySQL queries to make sure I updated the string length properly.
These few updates were missed because some of the database entries had http://www.olddomain.com and some had http://olddomain.com. The plugin did not catch it all, but made it manageable to replace by hand.
Finally, I had to import this updated .sql dump into an empty Wordpress database on the new domain.
Moral of the story is that Headway V3 is not simple to migrate to a new domain. You must be very meticulous.
Another option, that I did not try because it costs >$75 was BackupBuddy. It's likely that BackupBuddy will still miss some domain and file path updates, so be careful.
I have found the solution of T. Brian Jones and have just applied it for WordPress 3.8.1 with HEADWAY 3.6.2.
All works fine.
One trick for newbes like me: if you don't know the file path on the server where you are moving your database, before you do database dump install WP Migrate DB on this server, run the plugin (Tools) and get the path from there...
Thank's TBJ
Maciej

Resources