WP: When you transfer a site on WordPress to a new domain theme settings are reset to default (problem solved)
Category: WordPress
To transfer a typical site on WordPress to a new domain should follow these steps:
- Change the name of the domain in all files and databases
- Change the path from the root of the server in all files and databases
- Fill in the modified files and database
- Connect the database in the settings file wp_config
Sometimes these steps do not allow you to properly transfer the site to another domain. The reason is that the database stores not only the domain itself, but also the checksum.
The checksum can be the number of characters in an array of theme setting values. To put it simply: As you can see, domain also relates to topic settings, and changing a domain causes the checksum to change as well.
There are ready-made software solutions that allow you to make changes to the database automatically, taking into account the correction of checksums.
An example of such a solution is Search-Replace-DB. At the time of publication, the current version is v4.1.2.
- Download the archive with Search-Replace-DB v4.1.2 from code.idma.ltd.
- Link to Search-Replace-DB on github.com
How does this software solution work?
- You make a backup of the database.
- You download it.
- Upload it to an arbitrary place on the server.
- Access the root file to open the control panel.
- In the open panel, enter the data into the database and check the connection.
- The checkbox to the parameter use regex do not need to put.
- Select the item “all tables”.
- Run the script for execution.
- Check the work site with the new database.
- Important! Delete the used script from the site.
Autotranslate to UK
Для перенесення типового сайту на вордпрес на новий домен потрібно виконати такі дії:
- змінити назву домену у всіх файлах та базі даних
- змінити шлях від кореня сервера у всіх файлах та базі даних
- залити змінені файли та базу даних
- підключити базу даних у файлі налаштувань wp_config
Іноді ці кроки неможливо коректно перенести сайт на інший домен. Причина у тому, що у базі даних зберігається як сам домен, а й контрольна сума.
Як контрольна сума може бути кількість символів у масиві значень налаштування теми. Спрощене для розуміння суті пояснення: Як ви розумієте, домен теж відноситься до налаштувань теми, і зміна домену тягне за собою і зміна контрольної суми.
Існують готові програмні рішення, які дозволяють автоматично вносити зміни в базу даних з урахуванням корекції контрольних сум.
Прикладом такого рішення є Search-Replace-DB. На момент публікації поточна версія v4.1.2.
- Search-Replace-DB-4.1.2 (з нашого сайту)
- Посилання на Search-Replace-DB на github.com
Як працює це програмне рішення?
- Робите резервну копію бази даних.
- Завантажуєте скрипт з посилань.
- Завантажте скрипт в довільне місце на сервері.
- Запускаєте кореневий файл, щоб відкрити панель керування.
- У відкритій панелі вводите дані в базу даних і перевіряєте підключення.
- Прапорець для параметра use regex ставити не потрібно.
- Виберіть пункт «всі таблиці».
- Запустіть сценарій на виконання.
- Перевірте перенесений сайт з новою базою даних.
- Важливо! Видаліть використаний скрипт із сайту.