Files uploaded one domain to another domain but menu not working - php

I have configured a site using WP on my Development Server and now I have moved it to another server with new URL. I have changed URL in database as well. But, my menus are pointing to the OLD URL and I am getting a 404 error.
How can I change them?

Try to use some wordpress plugins to migrate your website between servers.
Duplicator is one of them.
https://wordpress.org/plugins/duplicator/
You will have to do minimum effort if you use some tools.

Make SQL dump, overwrite old domain, load dump.
Also checks configuration files & themes.

You probably forget some links in your database. Check the following fields:
In wp_options, options with the following option_name:
siteurl, home
In wp_posts:
Check all the guid values.
You need also to check that your .htaccess is using the correct RewriteBase.
If your menus are built from a special theme feature (not the default WP menu functionality), you may have some encoded string in wp_options that reflect the menu settings. If so check on this procedure.

Related

WP-Admin redirects to old URL (after editing config.php)

I am trying to get a client's WordPress site copied over to my company's server to use as a development site. I've ran into an issue when trying to log into the site's administrator panel; it redirects us to the existing site's URL instead (ending up as [OLD SITE]/[NEW URL]/wp-admin). Additionally, trying to go to any page other than the homepage gets a 404.
I've tried editing the wp-config and defining the WP_HOME and WP_SITEURL there, with no success. In a previous attempt we used a backup tool that was meant to replace references to the old URL with the new URL, and on another we ran queries and checked through wp-options in the database to be sure that we caught all of the old references. Still redirects to the old site.
We've tried restoring from two backups, Akeeba and BackUpWordPress. Our current attempt is a copy we've downloaded directly and then uploaded (with an imported SQL backup).
Another odd thing I've noted is that changing one of the URLs in the database causes more issues. Mainly, if I update the URL of 'wordpress-https_ssl_host' in the wp-options table, the theme breaks. Not sure where to go with this from here.
I'm always succesfully using the following script : search & replace:
https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
in order to update a wordpress site url.
Just copy the provided code in a directory under your site, then launch the provided index.php in a browser: the database infos should be automatically determined. Then specify the old and new urls and click on "Run" !
Don't forget to remove the created directory afterwards.
For solving this issue you have to change siteurl in database wp_options table
option_name = siteurl where
option_value = YOUR OLD SITE URL
change your old site url and update it with your local developement site URL
Hope this will help you..
We found the problem; as it turns out it was nothing to do with anything from the default WordPress files. The client was using an extension called WordPress HTTPS, and apparently that was causing a conflict somewhere. We renamed the extension's folder to disable it and everything ran fine. I imagine it was overriding what we were setting in wp-config.

Migrating Wordpress to a site with a subdirectory

I've migrated many Wordpress sites before, but now I'm having an issue I just can't seem to solve. Some, but not all of the links are not loading properly.
I'm migrating from local.dev to example.com/test.
In my database options, I have both options set to example.com/test.
I doubled checked the options in the WP backend, and they're example.com/test.
I've updated my permalinks.
All of the pages work, all of the links work, but a few references to images, etc do not - they're loading example.com/ instead of example.com/test.
I think it might have to do with the .htaccess file, because I can't update it from the FTP side. If I delete it and update permalinks, no .htaccess file is created. I don't have access to any server side overrides, only the files.
In my MAMP vhosts, I have SymLinks Override set to All, but I can't edit anything like that on the live host.
The links that aren't working are along the lines of $image = get_post_meta(37 ,'_my_meta',TRUE)['img']; which should return
http://www.example.com/test/wp-content/uploads/image.jpg
but instead returns
http://www.example.com/wp-content/uploads/image.jpg.
Using bloginfo('wpurl'); returns http://www.example.com/test, and all similar ones return properly (site_url();, 'template_directory', etc.
In the end, the site is going to go on http://www.example.com without the subdirectory anyway, but I'm sure I have to get it to work properly to prevent future errors.
I also updated to the newest version of Wordpress at some point, not sure if that could cause any issues.
I believe the issue deals with media and links placed in content items.
I use to do some manual SQL queries to fix this but now I run this plug-in https://wordpress.org/plugins/automatic-domain-changer/
The plug-in will go through all the content and make the needed changes.
The links that aren't working are along the lines of $image => get_post_meta(37 ,'_my_meta',TRUE)['img']; which should return
http://www.example.com/test/wp-content/uploads/image.jpg
this meta information is stored in the DB. then to make the migration you have to change all the old URL in the DB before to import it in the new place

How to Transfer Wordpress Website?

i want to transfer wordpress website from one hosting provider to another. i try also transfer but after transfer i can not change the Permalink.i change the Permalink from default to Post name. but err shown ...
"404 Not Found"
set old-domain to new-domain in guid column in the wp-post table in WordPress database
And also change the siteurl and home in wp-option table.
check below link
https://wordpress.org/support/topic/updating-links-in-old-posts-when-things-change
There are a number of things that could be wrong. Usually this error occurs when there is no .htaccess file present, or it's not configured correctly. (Keep in mind: if you new host is not running Apache, then you're not dealing with .htaccess altogether) It might also be that mod_rewrite is not set.
First thing to try though: set your permalinks back to default, or date and save it. Then set it back to pretty permalinks with %postname% and save it. Quite often this actually solves your issue in case the correct accessfile is actually present. :')
It also depends on whether you have changed the domain?
Look at this: https://codex.wordpress.org/Moving_WordPress
i think problem is in your database replacement.
please try this link Click here to download file and relapse your database.
before run this file make backup your database.
following this step.
i)uplode download file in your folder(root folder eg.wp-config.php location).
ii)run this folder.
iii)first run as dry run.if any change is found than run as live.
For me, only way you should ever do it if you at least don't have solid server-side knowledge is using All-in-one WP Migration plugin.
https://wordpress.org/plugins/all-in-one-wp-migration/
It allows you to export your database, media files, plugins, and themes. You can apply unlimited find/replace operations on your database and the plugin will also fix any serialization problems that occur during find/replace operations.
There is a WordPress plugin called duplicator. Using this plugin we can transfer WordPress website from one host to another. I think this is the simple and easy way to transfer WordPress sit. Here is the link.

wp-admin can't access after moving

I need mention that I had google search the solution before post at here.
I move my wordpress site to another domain and different server.
wp_config.php edited; database, database username, passwword, and host all changed. table_prefix remain the same because i use the same one.
wp_posts and wp_option i had changed too.
I still got this error message anyway.
You do not have sufficient permissions to access this page
Anyone know what happen and how to fix this ?
wp-admin can't access after moving
If you are moving your domain without changing the Home and Site URLs of your WordPress site you can follow the below guidelines as prescribed by the wordpress codex.
If database and URL remain the same, you can move by just copying your files and database.
If database name or user changes, edit wp-config.php to have the correct values.
If you want to test before you switch, you must temporarily change "siteurl" and "home" in the database table "wp_options" (through phpMyAdmin or similar).
If you had any kind of rewrites (permalinks) setup you must disable .htaccess and reconfigure permalinks when it goes live.
EDIT (if your site url has also changed, well i am only phrasing from the codex site)
Moving a website and changing your domain name or URLs (i.e. from http://example.com/site to http://example.com, or http://example.com to http://example.net) requires the following steps - in sequence.
Download your existing site files.
Export your database - go in to mySQL and export the database.
Move the backed up files and database into a new folder - somewhere safe - this is your site backup.
Log in to the site you want to move and go to Settings > General, then change the URLs. (ie from http://example.com/ to http://example.net ) - save the settings and expect to see a 404 page.
Download your site files again.
Export the database again.
Edit wp-config.php with the new server's mySQL database name, user and password.
Upload the files.
Import the database on the new server.
When your domain name or URLs change there are additional concerns. The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.
If you do a search and replace on your entire database to change the URLs, you can cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break. To avoid that serialization issue, you have two options:
Only perform a search and replace on the wp_posts table.
Use the Search and Replace for WordPress Databases Script to safely change all instances.
Make sure that the web server is allowing you to view the page itself, and look in the httpd.conf or .htaccess file for the directory that the main Wordpress script lives in.
Make sure that the Wordpress files have the correct permissions. If you just copied them over, then the user that needs to accesses them (apache on many typical LAMP installs, but yours may be different) is able to.
If you have already copied all your files and moved all of it to the new directory, then all you need to do is set your site url, home url.
So for example, if you are working on wordpress locally, you might have had your original URL to something like this:
http://localhost/wordpress
and your new URL might be something like this:
http://wordpress.local
In the case above, you would need to modify your settings in the database.
Database settings:
Go to the wp_options table, and look for the column named option_name, look at the field that says siteurl and home. You will notice that next to them in the option_value field you had your old URL. Change this to your new URL, and you should be good to go.
Hope this helps.

moving a wordpress website to a different url

I have a wordpress website for a minecraft server, the server name changed, so the website domain changed. I tried moving the forums to the other url, by coping and pasting all the files but using the same exact database. However, as you use website, it links you back to the original website a lot. If is the problem that the main domain name is inside the mysql database? If i change all domains inside the database, will this fully move the website?
Thanks
In your wp-config.php file, enter the line define('RELOCATE',true);
Access your login page from http://yoursiteurl.com/wp-login.php, go to settings and change the site url.
Remove define('RELOCATE',true); from wp-config.php
Wordpress has a whole guide on moving wordpress sites: http://codex.wordpress.org/Moving_WordPress
but the basic step is as follows:
goto: Administration > Settings > General panel, and change the site URLs there to your new url. this should update all post links, etc. in the database.
move files to new host
move database to new host.
Moving a WordPress web site is quite well documented here:
http://codex.wordpress.org/Moving_WordPress
If not, it really is just as simple as copying all the files and the database. To avoid FTP transmission errors and such, I have had more luck with compressing all the files into a single .tar.gz file then FTP'ing that to my computer and to the new web site, where I expand it.
Personally, I use cPanel (the most popular web hosting customer account/web site management tool). Their Backup and Restore for the database. And their File Manager's Compress and Expand to work with the .tar.gz
Changing domain names significantly complicates matters. I use the Search and Replace plug-in to handle hard-coded URLs. Or manually find and replace the URL in the database script.
Run this SQL to change url's in db.
UPDATE wp_posts SET guid = REPLACE(guid, 'old-url.com', 'new-url.com');
UPDATE wp_posts SET post_content = REPLACE(post_content, 'old-url.com', 'new-url.com');
UPDATE wp_options SET option_value = REPLACE(option_value, 'old-url.com', 'new-url.com');

Categories