Moved a WordPress install from an old directory into root directory - wordpress

I have a Wordpress site that was installed in a /wordpress/ folder, so when you try to access the website it will look like www.example-domain.com/wordpress/
The problem is recently I decided to move it to the root directory so that the site can be accessed by just going to the www.example-domain.com
So what I did first is download SQL dump, then delete the old installation of WordPress, installed a fresh one and overwrite the Database using SQL dump.
Everything went well, but when I tried to view the site this came up.
And I also noticed that whenever I tried to access to the dashboard through www.example-domain.com/wp-login.php
It will say that it is missing
The requested URL /wordpress/wp-login.php was not found on this
server.
So I am under the impression that it still points to the old installation.
How can I fix this?

You need to login to the database and manually edit 2 entries. In the wp_options table you can find siteurl and home. Update those appropriately, you should then be able to login properly.
You also need to update your .htaccess file but if you edit your permalink options and then change them back this should rewrite it for you.
For future reference to simply change directory of your installation if you login to the WP admin and go to Admin -> Settings -> General you can change the Wordpress Address and Site Address (the options you changed manually in the database) there. Once changed simply copy the entire installation folder to the new location and that will be it. It's easier to make the changes before you move it than after.

Update the table wp_options for siteurl and home with respective values.
Also change .htaccess file

You need to set a couple of paths in the database to the new directory.
try to search for records that include "/wordpress" and remove it.
This solved a similar problem for me.

Related

Not Acceptable?

My site is running but I could not log in to admin dashboard, got this error
Not Acceptable!
An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.
After googling I found out it has to do with mod_security. I tried every approach to fix it: changed my plugin folder name, tried disabling mod_security with .htaccess but the error remains the same.
Are there other alternatives that I could take?
Difficult question! To be honest, I wouldn't try to fix it. I would suggest copying files and database to a local WordPress. If everything is running on you local machine, I would delete the WordPress server version and install a new WordPress and copy the database and all the files.
If you think of the hours, you try to fix it instead of copy the whole WordPress and install a new one.
please delete you .htaccess file from the root directory and try to login into wp-admin. Once login gets successfully then regenerate the .htaccess file.
For regenerate the .htaccess file you need to follow the below steps:
Go to setting -> permalink -> change permalink into default.
And save the setting.
After save setting then change permalink into the post.
Now you can see that the .htaccess file gets generated successfully.

How to move Wordpress to another domain without the chance to make a proper backup first?

So my webhoster closed down, where I hosted my Wordpress blog. I was able to receive a zip file containing all my data. I now have a new webhoster and I extracted the zip file to its root directory.
Trying to open my website now gives me "Error establishing database connection". The web tells me it may be related to hardcoded urls in the Wordpress database, which I need to replace by the new url.
However the tutorials usually tell you to use the Wordpress interface to create a backup of my database first, which can then be edited in tools like phpmyadmin. I can not access the Wordpress interface anymore and so far did not manage to edit the database otherwise.
I tried placing a local copy of the blog in the "C:\xampp\htdocs" folder, hoping phpmyadmin would recognize the database and allow me to edit it. Not working, maybe I am doing something wrong?
Any ideas to revive my Wordpress blog?
Cheers
Okay I think I got it working. For people having the same issue:
I loaded the database locally by copying the *.myd, *.myi, *.frm files to a new folder in my local xampp installation (e.g. C:\xampp\mysql\data\myDatabase).
I then used phpmyadmin to export this database to a .sql file.
On my webserver I then installed a fresh wordpress blog. It might be enough to copy your existing wordpress stuff, without needing to do this step afterwards, not sure.
My webhost has phpmyadmin preinstalled, so I used that to delete the fresh wordpress databases and import the .sql file instead. Now everything is in place, but since I changed my domain I need to change the URL paths in the database.
I used this script (use it by placing it on your webserver in the wordpress root folder and calling it in the browser) to do a search&replace of my old url to the new url: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
After that I only had to manually fix the path to my header image that I had edited in the past in the theme's header.php file.
Phew. Thanks for your help f00644.

Tried to Move Wordpress from Subdirectory to Domain, Site Broke

I tried to move my beta Wordpress site to my live domain, and now everything's broken. I have no idea how to fix this. Here's what I did:
I had a site running at mydomain.com, but I wanted to rebuild it. So I downloaded a new installation of WordPress at mydomain.com/test and built a new theme.
I finished the new theme and was ready to move it to mydomain.com. I decided to leave everything in the subdomain for the move, so I followed these instructions.
It worked fine. Mydomain.com was displaying the new site.
Then, I stupidly decided that I wanted to rename the subdirectory from /test to /v2 (because I wanted a cleaner name and I wanted to leave /test open for testing rather than use it for my new site).
Everything broke.
I tried to change the subdirectory back to /test because the site was working with that, but everything is still broken. The theme doesn't seem to be loading. My site is not displaying any styles. My photos aren't displaying correctly. My plugins are gone.
Is there any way to fix this? Please tell me I didn't just lose 3 months of work...
This is my site.
The database,will have the url set to mydomain.com/test
you will need to update the db entries see below script
http://dan.doezema.com/2010/04/wordpress-domain-change/
Sounds like you need to update your siteurl and home values in your Wordpress Database. Log in to your cPanel and go to phpMyAdmin. From there you should be able to open your WordPress MySQL Database.
Go to your wp-options table and make sure that your siteurl (option_id 1) and home (option_id 37) values are using the correct path ie http://mcography.com/test
You may also need to update your permalinks. Even though you don't have to change any options, saving the permalinks again should refresh your .htaccess file.

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

Activate a second wordpress-installation on a domain

I have installed wordpress on a domain and I'm gonna add a second language so I've also installed another wordpress in a subdirectory. Now it's located in:
mysite.com/en/wordpress
but i need it to be
mysite.com/en
For the first installation i followed this guide:
http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
But it seems like it doesn't work with multisites.... So do I fix this?
No it's no problem to change it. A few steps to follow.
Go into your WordPress admin panel and update the site url and blog url to point to your new location. Then click save.
Rename the folder from wordpress to en
Finally you may have some problems with images, if so you will need to replace the old urls in your database. Personally I would import the database, run a find and replace and then re-import the sql script.
Here is another solution though that runs a query on the database and will also work. http://www.master-script.com/moving-wordpress-site-to-new-domain.html
Note if you are going to run the find and replace on the database anyway the first step is irrelevant as it will be changed also.

Resources