Wordpress wants to install itself, rather than run the blog - wordpress

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

Related

Cloned WordPress site behaving differently from original

A WordPress-based website has been developed on an Amazon AWS AMI instance. Let's refer to that site as http://example.com. For the purpose of testing changes to the site, from the Amazon AWS EC2 control panel, I stopped the running instance, created an image of it, and then launched a new instance using that image. I created a DNS record for clone.example.com and pointed that to the cloned instance.
Once the clone instance launched, I did the following:
Created a new LetsEncrypt certificate for clone.example.com and updated /etc/httpd/conf.d/ssl.conf accordingly.
Using mySql Workbench, downloaded a copy of the database and removed the schema
Edited the database file, changing all instances of http{s}://example.com to http{s}://clone.example.com
Uploaded the database into a new schema with the same name
Searched all files in /var/www/html for the string example.com but did not find it anyplace that matters
I was then able to access the cloned site, the security certificate worked, but the site is different from the original. By different, certain colors, layouts, etc., are not the same.
The WordPress site in questions used a variety of plugins, including:
BuddyPress and several affiliated plugins
BP Portfolio
Gravity Forms
WooCommerse and several affiliated plugins
Can you please suggest what I can try to get the cloned site to behave like the original? Thanks!
I dug in and figure this out the hard way - I changed each instance of https://example.com to https://clone.example.com until I found the one that broke the site.
The problem was in the table wp_options (not surprising) and the entry that caused the problems was social_portfolio_options. This is a case of laziness on the developers' part - instead of doing the right thing, i.e., creating a table to store the options; they used a long string with each part being delimited by its length. Thus, changing the URL caused the string parsing to break.
I remembered facing a similar issue relating to CSS while cloning a wordpress site months ago. However, this wasn't done on AWS but on another hosting provider. What happened was that the page-id on my cloned site was new and different from the one used previously. The issue was resolved after updating onto the existing styles.css with the new page-id.
This is not an answer. I wanted to leave it as a comment but lacked the reputation.

How to change the domain only without migrating the files

I have two business domains, for example, domain.com and dev.domain.com.
Since I had to keep the old website for running the business while developing website, I keep the old website to domain.com and bought the new theme, installed, and developed in dev.domain.com.
After finished the development, I wanted to use the domain.com instead of dev.domain.com, but when I migrate all the file, all the plug-ins were not working because of license reason.
Since I don't want to develop entire website again, I just made domain.com to forwarding to dev.domain.com.
Is there way I can change domain to domain.com?
Thanks,
Not entirely sure but you're probably getting errors because WordPress saves the site URL in the database so after you move the files to domain.com, the database is still requesting stuff from dev.domain.com. Changing the one table in the database (site_url under wp_options) is sometimes enough but if you've been developing a site I'm guessing you've got a bunch of links and images set up with the dev.domain.com URL. What I usually do when migrating a dev site to live is...
Set up a new Database and User/Pass for the new live site.
Export the database from the dev site.
Open the database in Notepad++
Use Find and Replace (ctr+h) to find dev.domain.com and replace with
domain.com, choosing Replace All.
Now import this database to the new database you set up earlier, and
change the wp-config.php database settings to the new database.
Be sure to keep copies of the backup before you edit the database in case anything goes wrong, but you should be good. This is how I do it all the time.
https://codex.wordpress.org/Moving_WordPress#If_You_Have_Accidentally_Changed_your_WordPress_Site_URL.
This https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ is probably a better method than trying to load your entire db into a single text file is not the most viable option.

What step have i missed? Transferring wordpress site

So i have recently tried to transfer my wordpress site to another server.
I have followed a few guides, but i definately seem to be missing a step.
Basically what i have done is:
export original database (phpMyAdmin)
Save all relevant files (ftp)
install fresh wordpress on new server. (wp backend)
'drop' all table fields in new wordpress (phpMyAdmin)
import original database to new location (phpMyAdmin)
transfer theme, plugins, uploads. (ftp)
activate theme, plugins. (wp backend)
update permalinks. (wp backend)
The problem is, i am left with a default looking wordpress installation, and not my orginal page-home.php and corresponding css.
Also, if i go to wordpress backend SETTINGS > READING > Frontpage:static; i only have the option of 'about', not home, i should have 'home'...
Sorry if i am vague, let me know if any screenshots are required.
We really need a little more info like:
when you say plain, do you mean just the theme is not set and you're on the default theme, or there is no theme, or do you mean even your content is not there?
the site you removed it from, where was the installation located? Was is in the public_html folder or a subfolder of that? Did you put it in the same place, ie not inadvertently put it in a different folder
(I've actually typed the bulk of the post and come back to the top for this one, but):
Are you sure you're checking the right site?
Have you kept the same domain name?
Has the domain name propagated to the new server?
Is the CSS being loaded from the correct domain (has anything been hardcoded to the old server)
Let's go through a few broader options:
1. Check how many WordPress installs are on your domain
First off, it sounds like you may have two WordPress installations. If you have the backend setup correctly with your themes but you're seeing a plain site, it sounds like you're looking at another install. I'm not saying you do have multiple installs, but it is a place to start looking.
A question to ask yourself here is: In this plain looking site, do you see your content, or the content of a default site? If you see your content, you may jump ahead to section 2.
If you're saying there is a home page but you're not seeing it as available under static pages, either:
You're looking at another site (but there should be a home page* even in a default setup—from memory), or
You're Home Page title may have changed, or have become "unpublished", ie reverted to a draft, or pending review. Check the page:
actually exists,
has the title you're looking for
the slug hasn't changed
(*note: although it could be a Welcome Page I'm thinking of here.)
Double check the database
The easiest way to do this is to go into your database and see how many WP databases there are. Check each database and look for the underlying table structure, it sounds like you should be able to identify it pretty easily. If it's not a multisite install, the table prefixes should be wp_ unless you changed them somewhere.
While you're playing around in the database, Take note of the database name and table prefix.
Double check the folder structure
Have a look for a second instance of your folder structure, maybe you dropped it into the wrong place).
2. Check the WordPress installation is actually connected to the database
Check the WordPress configuration file wp-config.php is connected to the database. Check wp-config.php sample from codex, you'll want to see the correct database name and table prefix in there.
From here you should also check the username has been setup correctly and is as you expect it. Remember, the database name will likely have a different prefix between hosting providers, unless you've managed to keep the same login name with each provider. ie, I'm talking about the database prefix here, not the table prefix.
(another note: most database connection issues will result in errors appearing on the page in lieu of your site, which leads me to believe it's at least partially setup correctly.)
TEST: What you can do is rename the old wp-config.php to something else and don't create a new one, then visit the website and it will lead you into setting it up again where you can enter the database details (your site info will still be intact, this will only reset your config file, not the database, although it could reset the connection between the filesystem and database).
3. Domain name propagation and DNS settings with your new host
As I mentioned previously, are you checking the right server? Are you sure the domain name has been propagated (if you're using the same domain name that is).
Check the IP address with your DNS provider (for your domain name) is correctly pointed to your new server
Then check that from your command line by typing ping {your-domain-name} and see that your IP address comes up
Check the DNS settings with your web host are setup correctly and that your domain name points to where you want it to point to (ie, public_html or the relevant subdirectory there-of). (This resally does come back to point one, which if you covered it, this shouldn't be an issue
Check that you dropped the files (and all the files) into the correct physical directory, ie public_html (or sub-dir)
If none of these help, please leave a comment with any further developments you've made and as much info as possible, and we can start looking in other areas.
*notes about the database name:
when playing with WordPress directly, ie in the configuration files or the backend administration settings, the database will include your {username}[underscore or hyphen]{database-name}
when playing in phpMyAdmin, they will already be included and you will just provide the {database-name}.
Fellow this steps
export your sql from cpanel---phpmyadmin
make zip of your files in cpanel
import the file in new domain and extract it
create a database link to the new domain
go to new database which you have reacted through phpmyadmin--delete all the tables which was installed by wordpress.
import that sql file which you have downloaded from old website
and in phpmyadmin change the url to new domain name
Regards
Follow these steps:
export database from phpmyadmin.
zip your WordPress project via c-panel.
upload zip file on new domain via c-panel.
extract zip file.
create new database and import old database in new phpmyadmin.
configure user name and password and database name.
change url in database table. from wp_operation table home_url and site_url
Thanks

Mirroring a Wordpress *configuration* between local and remote

Ok, so I'm familiar with creating local Wordpress builds, and have been chugging along happily with the technique outlined in Smashing's MAMP-based article. My question goes a step beyond this.
The article is great for developing generic themes, but when developing sites (not necessarily blogs) based in Wordpress, for me at least, it's a little painful come launch day.
I have to go back in and reconfigure the server's Wordpress to match what I've already done locally. Settings have to be entered again, plugins need be installed again, menus recreated, and css will have to be altered to reference the unique classes/id's Wordpress generates for posts/pages/custom taxonomies…sometimes things are missed in the process. What I want to know is this:
Is there an easy way to automate cloning or mirroring the build on my local machine to the remote server?
Even if you have to just LMGTFY me, that would help. I don't exactly know what I should be searching for. Searches dealing with 'mirroring wordpress configuration' and 'cloning wordpress configuration' returns tutorials on moving content, which I know how to do.
If it helps, I'm running OSX 10.6.8 with xcode dev tools, git, ruby, node, and homebrew. All of my live servers have ssh access as well as ftp, and I build with the most current versions of Wordpress.
Here are some easy steps to follow:
Download and install the WP Migrate DB plugin.
Go to Tools > WP Migrate DB and fill-in the blank fields(New address (URL), New file path and optionally check/uncheck the other options). Click on Export Database and save the export file to your computer.
Make a .zip archive with ALL of your files(the /wp-admin, /wp-content, /wp-includes directories and all files in the root directory).
Upload that file to your production server, where you want your WordPress site to reside.
Go to your cPanel(or use the unzip command through SSH) File Manager(or any other alternative that you might have) and unzip the file that you just uploaded.
If you don't already have a Database set-up on your production server - create one through the hosting control panel(for cPanel, it would be Creating a mySQL database in cPanel, for plesk it would be Plesk 7 Tutorial: Creating a database, for anything else, just google it up, or try your hosting's FAQ). Remember/write-down your Database Name, Database User and Password.
Edit the wp-config.php file and change the values for the DB_NAME, DB_USER, DB_PASSWORD and optionally DB_HOST - but this is usually localhost - if that doesn't work try asking your web host, or if you have phpMyAdmin, log-in to it and look at the very top of the page - in this case the DB_HOST would be localhost.
After you've done all of that, log-in to your DB administration tool(most of the time this would be phpMyAdmin, but it could be something else as well) and upload the database export file that you save to your computer in step 2. Note: If your hosting hasn't provided you with a DB administration tool, I would suggest that you upload the phpMiniAdmin(click on the "Download latest version" link and save the file to your computer) script to your production server. Then go to that script(if your website is located at http://example.com/, go to http://example.com/phpminiadmin.php) and enter your DB details. On top of that page, you will see an import link. Click on it and upload your DB export file. Note 2: phpMiniAdmin doesn't support gzip-compressed files, so if you did check the Compress file with gzip option in step 2, you will have to re-do that step with this option unchecked.
Log-in to your site and go to Settings > Permalinks in order to update your permalink structure.
Check the permissions of the /wp-content/uploads and /wp-content/plugins directories - make sure that you will be able to upload images and plugins without any problems.
That's pretty much it. It might seem like a lot, but I follow this process for almost every site that I upload to production servers and it can take me as less as a bit under 10 minutes to do all of that(considering that I usually use custom MySQL commands, instead of the WP Migrate DB plugin - I should probably start using it :) ). Once you get used to the process and you don't encounter any low-quality web hostings, you should be perfectly fine with these steps.
Note: Since you used ssh as one of your tags, I assume that you usually have ssh access to the production server. If you don't I'm still assuming that you have a cPanel access(if that's not true and you can't unzip files on the server, then upload all files manually via FTP client, instead of doing steps 3 and 4).
I guess the only way is to copy the database or part of it.
What I do is to copy the relevant tables and modify manually the site URLs in table options. There are only 2. There is also a nice plugin velvet-blues-update-urls to modify all links, after the site URLs are set manually to be able to access the backend, in case posts are also copied.
Next, copy all theme directory files to the same directory in the site, assuming you are using the same theme.
Both processes can be automated with a PHP script.
I am not sure this is what you want, but hope this helps.
Not sure that this is exactly what you need, but to move a site you can use the built in Wordpress "export" and "import" options. As far as I remember there was an option when importing to change URL's and the import would change a few things for you.
Even if this does not answer your exact question, hope it helps.

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