I just migrated my website
Exactly how did you do that?
-or-
What did you actually do or not do while trying to do that successfully?
Thread Starter
Tameto
(@tameto)
I transferred the wp directory from the directory of the main subdomain to the one of the main domain and i changed the addres in the database
I transferred the wp directory
i changed the address in the database
After making a database backup, edit ‘pref’ to your own table_prefix and then replace ‘http://www.olddomain.com’ and ‘http://www.newdomain.com’ with your own and run this SQL at phpMyAdmin:
UPDATE pref_options SET option_value = replace(option_value, 'http://www.olddomain.com', 'http://www.newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE pref_posts SET guid = replace(guid, 'http://www.olddomain.com', 'http://www.newdomain.com');
UPDATE pref_posts SET post_content = replace(post_content, 'http://www.olddomain.com', 'http://www.newdomain.com');
Doing that should find-and-update all related instances beyond your initial address change.
Thread Starter
Tameto
(@tameto)
Thanks a lot for your help.
Can you just be a bit more specific and guide me more precisely through the steps? what do you mean with “edit ‘pref’ to your own table_prefix”
and where shall I run the commands you gave me? where I find the console on phpMyAdmin??
Thanks again
T
These need to be prefixed with your own table_prefix:
UPDATE pref_options
UPDATE pref_posts
UPDATE pref_posts
example:
UPDATE wp_options
UPDATE wp_posts
UPDATE wp_posts
That is how SQL will know what table/s to modify.
and where shall I run the commands you gave me? where I find the console on phpMyAdmin??
Yes. Click/select your database in phpMyAdmin, then click the ‘SQL’ button you should see there and then paste your edited code into the SQL box and click “Go” or whatever to run it. You should then almost immediately see a report that will show something like “number of rows affected” at the end of each line.
If you might want to do a little looking beforehand, select your database and then “Search” and “all tables” and then paste in your old URL and “Go” to just see what instances you might discover.
Thread Starter
Tameto
(@tameto)
cool.
I did that but stil i get Page not found error… 🙁
What’s next?
Thanks
T
You might try either renaming (to disable and hold as a backup) or deleting your current .htaccess file and then re-saving it (indirectly making a new one) at Dashboard > Settings > Permalinks. Doing that has worked for me a couple of times after moving a database. Beyond that, however, I am out of guesses here other than to look at each page and its slug in the editor and/or to possibly do a delete-and-replace at Dashboard > Appearance > Menus.
Thread Starter
Tameto
(@tameto)
mhm… there is something weird… basically i don’t have a .htaccess file on my server… and at Dashboard > Settings > Permalinks i see this
“If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.”
the problem is also that i don’t manage to make my web directory writable from public.
Where can i find a .htaccess file to manually put it in the we directory? i don’t have one in the folder of wordpress i downloaded.
ps. the hidden files are viewable both on my laptop and on my server.
THaaanks
T