After migrating website rederection to old website - php

I just migrated my website and it keeps rederection to another domainname of mine. Before I did this I open de SQL file and replaced the old domain with the new one. And imported it this in a new database. After that I configured the wp-admin. So after done this it should work right? In can access the website through wp-admin and that seems to work, but when I just type in the URL it rederection to another old domain of mine.
Anyone any idea how to fix this?

Seems like you missed some records in the database. The best approach is to use a tool like https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
If you download this free tool and upload to your server then it does a batch find-and-replace across every single table in your Wordpress database.
So, for example, replace http://www.example.com with http://sub.example.com
You can do a dry run and it will show you all the replaces that it will make. Once you're happy then click the "live run" button and all the changes are made.
I use this tool all the time when I am moving a site from my local machine to the live server. I also use the exact same approach when migrating a site from http to https

Related

hosting an old part of a php site on a subdomain?

This is my first post here, I'm also kinda new to web dev.
I made a new site for a client an changed the hosting of the domain.
But he wants an old part of the side witch is an catalog with sorting functions made with php behind a login. I want to host this on a subsite of the hosting. Can I "copy-paste" this catalog with ftp? i have a copy of the database and the full file of the old website. I know that the php version is out of date and I'm having trouble how to find a way to update this.
When i upload the site i get a permission error trying to visit it.
When I try it locally i get to the login screen and the first page of the catalog, but when i try to select a category I only get a white screen.
I already want to thank you all for the help.

How do I change a wordpress dev site url that was overwritten by live site backup

We have a dev site www.dev.site.co.za & a live site www.site.co.za.
I wanted the dev site updated to be a current replica of the live site, so our hosting provider copied it over.
But now when if you go to www.dev.site.co.za, you are "redirected" to www.site.co.za. I have tried changing the siteurl in phpmyadmin but that hasn't resolved the issue.
Is there somewhere else the url needs to corrected and is there anything else I need to do to make sure the dev site is a completely separate environment to the live site so I can safely fiddle without damaging the live site?
wordpress not only uses the database in PHPMyAdmin for the url.
As mentioned in the official documentation there are several files that can include the url:
the wp-config.php (wordpress file)
the functions.php (theme file)
Check these and have a look for the url address.
Have a look at the .htaccess file!
Also:
Helpful for that issue (e.g. restoring a wordpress page on another server) is the plugin BackupBuddy. It is one of the most well known plugins for wordpress. (Know right now that it is a paid version! But as always there are others with the functionality).
It allows you to backup and restore your page on a new system. You can initially set your new desired address for the system then.
Maybe it is worth a look!
For rectifying your dev site issue, you can try this.
Following is the URL to a simple utility via which you can replace some value in your database with some desired value.
https://github.com/interconnectit/Search-Replace-DB
Download the utility (zip file).
Upload it to your dev site root location and unzip it there. So that the the URL of the unzipped folder becomes: www.dev.site.co.za/Search-Replace-DB-master/.
Visiting that URL will show you the screen with options to replace some values in your database with desired values.
This utility automatically selected the connected database.
Put the URL of your live site in the field to replace.
Put the URL of your dev site in the field to replace with.
Choose the Dry Run option to see what all tables and columns will be affected.
Once you see the results and know what is changing then you the click on Live Run.
Clicking on Live Run will change all the URL of your live site in dev site database with URL of your dev site.
Once the changes are done you can delete this folder.
Hope this will at least resolve the problem of redirection of dev site to live site.
Once the new site is built you can then migrate(move, copy) it to the live site's location. There are some tools out there to help with moving the site you can use once the site is done. Some require a plugin to be installed to do that though. For example magicmigration can be used to move the completed site to a new location (that one specifically doesn't take extra installs). It is also possible to manually migrate the site though depending on the situation and know-how that can be a bit much for some people.

Working with staging and Live url wordpress

I made my wordpress site live by moving it from the staging url (staging.example.com) to the live url(www.example.com).
I wont be working on the site anymore so I have to advice my client on how to manage things on his own from now on.
I have 2 options:
Let the client add blog posts directly on the live. When it comes to installing plugins or
any other changes that might cause the site to break, I can ask him to clone the live site by
using plugins such as wp-staging, test the changes on staging url and if everything works as
expected, then make the same changes in live.
I can ask him to make all the changes (adding posts, plugins etc.) on the staging url first and then transfer the
files to the live url. But how would we transfer the db from stage to live without overwriting the live db?
Also I used this script
to change the url in db but I dont want to let my client use that script because being a non-technical person,
I am afraid that he might end up deleting the entire files on the server or that he might forget to
delete the script after using it.
Or is there a better option? I am new to wordpress. Any help would be greatly appreciated. Thanks.
You could use a backup plugin like backupwordpress or any of the other popular options out there to backup the database and files on a regular basis. Then run the backup right before making any plugin/theme updates.
Well usually staging urls are used when developing plugins or themes. In your case you are simply installing new plugins and adding posts to the WordPress. This is how WordPress is normally used and it does not require a development site.
If your client installs well known WordPress plugins which are well tested, then he should not have any problems with installing them.

Testing File Updates and Improvements without showing to users

I'm pretty new to web development and as I build websites using an Apache server, I was wondering how to prototype changes. For example, say I'm working on improving a PHP file that is already being displayed on the site. How can I test whether the changes I'm implementing work when the updated file is put on the server without disrupting users to the site if there is an error in the new code?
You should have a local copy of your site on your machine where you can test your codes, if that works, add it to your live website, Simple!

Renamed Wordpress-Heroku app admin pages redirect to old name

Using Wordpress-Heroku and ran into some issues. Changed my app name from heroku's autogenerated name to something more descriptive, but /wp-admin gets redirected to the old name. Of course there's no such app anymore. Also tried to set up a local version but found that going to localhost:8888/wp-admin redirects me to app on heroku.
I guess that something in the installation process creates permalinks to the site address in the database. Is there a way to fix this without resetting the installation?
I change servers (copying live sites to localhost) fairly frequently following the Codex. While not on Heroku, I assume the process would be the same.
In your case, the Search and Replace for WordPress Databases Script mentioned should do the trick (after backing up the database, of course).
I assume you've updated your wp-config.php to point to the new database.

Categories