{"id":351,"date":"2026-11-15T18:38:33","date_gmt":"2026-11-15T17:38:33","guid":{"rendered":"https:\/\/www.netlabor.it\/?p=351"},"modified":"2026-11-20T16:57:52","modified_gmt":"2026-11-20T15:57:52","slug":"spostare-wordpress-da-sito1-a-sito2-senza-ssh","status":"publish","type":"post","link":"https:\/\/www.netlabor.it\/en\/spostare-wordpress-da-sito1-a-sito2-senza-ssh\/","title":{"rendered":"Moving WordPress from \/site1\/ to \/site2\/ Without SSH"},"content":{"rendered":"\n<div class=\"wp-block-bogo-language-switcher\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The case:<\/strong> a WordPress site at <a href=\"https:\/\/example.com\/site1\/\" target=\"_blank\" rel=\"noopener\">https:\/\/example.com\/site1\/<\/a>, to be rebuilt and published at <a href=\"https:\/\/example.com\/site2\/\" target=\"_blank\" rel=\"noopener\">https:\/\/example.com\/site2\/<\/a>, on hosting without SSH access. The rebuild concerns only WordPress: theme, plugins, templates, PHP. The content is not touched: posts, pages, media, users and comments are and remain the production ones.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is not a content migration; it&#8217;s a code release with a folder change: you develop and test on a staging environment with a copy of the real data, then move only the files to production. The production database is cloned once, at the last moment, and the URLs are replaced once, because the staging addresses never enter the good data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Without SSH, rsync, wp search-replace, mysqldump and grep are out. What remains: the control panel, phpMyAdmin, SFTP and wp-admin. That&#8217;s enough, but the procedure is more manual.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The address map<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Phase<\/th><th>Public URL<\/th><th>Folder<\/th><th>Database<\/th><\/tr><\/thead><tbody><tr><td>Today (production)<\/td><td><a href=\"https:\/\/example.com\/site1\/\" target=\"_blank\" rel=\"noopener\">https:\/\/example.com\/site1\/<\/a><\/td><td>\/site1\/<\/td><td>db_production<\/td><\/tr><tr><td>Work (staging)<\/td><td><a href=\"https:\/\/staging.example.net\/site2\/\" target=\"_blank\" rel=\"noopener\">https:\/\/staging.example.net\/site2\/<\/a><\/td><td>\/site2\/ on the staging domain<\/td><td>db_staging<\/td><\/tr><tr><td>Tomorrow (production)<\/td><td><a href=\"https:\/\/example.com\/site2\/\" target=\"_blank\" rel=\"noopener\">https:\/\/example.com\/site2\/<\/a><\/td><td>\/site2\/<\/td><td>db_site2<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Three databases, three roles. db_production is untouchable until the cutover, and remains the backup copy. db_staging is a throwaway laboratory. db_site2 is the production clone that becomes the new site&#8217;s database.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What travels with the files and what stays in the database<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This distinction is the heart of everything else, and getting it wrong is why many releases &#8220;work&#8221; but the site comes out different.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>They are files:<\/strong> the theme and child theme, templates, CSS, theme images, plugins, mu-plugins, wp-config.php, .htaccess.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>They are database:<\/strong> content and media as records, menus, widgets, theme settings (theme_mods), plugin options, users, permalink structure, pages and slugs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Direct consequence: if on the new theme you configured header, colors, homepage and menus on staging, that configuration does not travel with the files. You only find it again if you export it from the database, or you redo it in wp-admin on \/site2\/ after activation. For a small site it takes ten minutes to redo and it&#8217;s the safest route; if the configuration is complex, you export only the rows you need from the database (theme_mods_nometema, widgets, plugin options), not entire tables.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 0 \u2014 Inventory and backup<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Look for WP_HOME and WP_SITEURL in wp-config.php. If they are defined, they win over the database options: any replacement on wp_options will have no effect and it will seem like the tool isn&#8217;t working.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">List the plugins that store absolute URLs or have their own tables: page builders (Elementor, Divi, WPBakery), forms, cache, WooCommerce, WPML. Each has a regeneration to do after the replacement.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the PHP version of the staging domain: equal to or higher than production. On shared hosting you change it from the panel, and it must be done before uploading the files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then the backups, kept outside the web root:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>production database:<\/strong> phpMyAdmin \u2192 db_production \u2192 Export \u2192 Custom \u2192 SQL, check Add DROP TABLE, gzip compression. The gzip matters: the upload limit of phpMyAdmin on shared hosting is often 32 or 64 MB, and a compressed dump fits where the raw one doesn&#8217;t;<\/li>\n\n\n\n<li><strong>production files:<\/strong> backup from the panel, or full download of \/site1\/ via SFTP;<\/li>\n\n\n\n<li><strong>.htaccess and wp-config.php:<\/strong> download them and put them in a folder with the date.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A backup is not a backup until you have opened it at least once. Check that the .sql contains data and not just CREATE TABLE.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 1 \u2014 Prepare staging<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Domain and certificate:<\/strong> point the staging domain to the hosting and activate TLS from the panel, before uploading the files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Folder and database:<\/strong> create \/site2\/ on the staging domain and an empty database with a dedicated user.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Protect staging before importing anything<\/strong>, in \/site2\/.htaccess:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># --- staging protection: remove at go-live ---\nAuthType Basic\nAuthName \"Staging\"\nAuthUserFile \/home\/youruser\/.htpasswd-staging\nRequire valid-user\nHeader always set X-Robots-Tag \"noindex, nofollow, noarchive\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You generate the .htpasswd-staging on your computer with <code>htpasswd -c .htpasswd-staging username<\/code> and upload it via SFTP to the hosting home. Don&#8217;t use online generators: you&#8217;d be sending a real password in plaintext.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If mod_headers is not active, the header doesn&#8217;t pass and you only notice when Google indexes the staging. In that case put the noindex via PHP:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php\n\/\/ wp-content\/mu-plugins\/staging-noindex.php\nadd_action( 'wp_head', function () {\n    echo '&lt;meta name=\"robots\" content=\"noindex,nofollow,noarchive\"&gt;';\n}, 1 );<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Deactivate email<\/strong>, otherwise tests of a form or an order send notifications to real users:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php\n\/\/ wp-content\/mu-plugins\/no-mail.php\nadd_filter( 'pre_wp_mail', '__return_false', 99 );<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note both mu-plugins: they must be removed at go-live. The second one, if forgotten, leaves the new site mute.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 2 \u2014 Transfer the files to staging<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the panel has a file manager with Compress and Extract, compress \/site1\/, download, upload to \/site2\/ and extract: it&#8217;s much faster than thousands of individual files. If not, SFTP with FileZilla: download to your computer, re-upload.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Tips:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>SFTP instead of FTP<\/strong> where possible: the password doesn&#8217;t travel in plaintext.<\/li>\n\n\n\n<li><strong>Exclude<\/strong> wp-content\/cache\/, wp-content\/upgrade\/, .git\/, node_modules\/, plugin backups, and the uploads folder if you only need to develop the theme and already have the media elsewhere.<\/li>\n\n\n\n<li><strong>Don&#8217;t copy wp-config.php from production:<\/strong> on staging you need a version with the db_staging credentials, new salts and <code>define( 'WP_ENVIRONMENT_TYPE', 'staging' )<\/code>.<\/li>\n\n\n\n<li><strong>Binary mode and 2-4 parallel connections;<\/strong> some shared hostings block clients that open too many.<\/li>\n\n\n\n<li><strong>Permissions at end of copy:<\/strong> folders 755, files 644.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">New salts: <a href=\"https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/\" target=\"_blank\" rel=\"noopener\">https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Phase 3 \u2014 Copy the real data to staging<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">One copy only, to work on realistic content: a new theme must be tested with the real menu, the real images, the real long texts.<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Production phpMyAdmin:<\/strong> Export db_production (SQL, gzip, DROP TABLE).<\/li>\n\n\n\n<li><strong>Staging phpMyAdmin:<\/strong> select db_staging \u2192 Import \u2192 upload the file.<\/li>\n\n\n\n<li><strong>Manually fix the two rows<\/strong> that let you log in:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted\">UPDATE wp_options SET option_value = 'https:\/\/staging.example.net\/site2' WHERE option_name IN ('home','siteurl');<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">These are simple values, not serialized: modifying them by hand is safe. Everything else is done by Better Search Replace.<\/p>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>Install Better Search Replace<\/strong> (Plugins \u2192 Add New) and from Tools replace, in dry run and then for real:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Search<\/th><th>Replace<\/th><\/tr><\/thead><tbody><tr><td><a href=\"https:\/\/example.com\/sito1\" target=\"_blank\" rel=\"noopener\">https:\/\/example.com\/sit<\/a>e1<\/td><td><a href=\"https:\/\/staging.example.net\/site2\" target=\"_blank\" rel=\"noopener\">https:\/\/staging.example.net\/site2<\/a><\/td><\/tr><tr><td><a href=\"http:\/\/example.com\/sito1\" target=\"_blank\" rel=\"noopener\">http:\/\/example.com\/sit<\/a>e1<\/td><td><a href=\"https:\/\/staging.example.net\/site2\" target=\"_blank\" rel=\"noopener\">https:\/\/staging.example.net\/site2<\/a><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This replacement only serves to make staging usable. It has an important consequence: the staging database is no longer identical to production, so it will never go back. It&#8217;s throwaway per project, and that&#8217;s why at go-live the database is taken from db_production and not from here.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Why Better Search Replace and not an UPDATE &#8230; REPLACE():<\/strong> WordPress stores many options in serialized form, with the string length written inside the value. If a URL goes from 28 to 24 characters and the length stays 28, the option becomes unreadable and WordPress silently discards it: you lose widgets, menus and theme settings with no error. BSR also rewrites those prefixes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The typical limits of shared hosting come back here too: if the import fails due to upload_max_filesize or max_allowed_packet, ask the provider to raise them for an hour or use BigDump.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Phase 4 \u2014 Rebuild and test<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now the real work, without any rush and without stopping anything: production continues to live with its content and its users.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What to do here, and what must have been done before the cutover:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>update core, themes and plugins on staging, checking after each step: it&#8217;s the only moment when you can afford to break something;<\/li>\n\n\n\n<li>test the new theme with real content: long pages, tables, images, embeds, forms;<\/li>\n\n\n\n<li>check plugins that depend on URLs or specific settings;<\/li>\n\n\n\n<li>keep a list of things that are not files and you&#8217;ll have to redo on \/site2\/: theme activation, menus, widgets, plugin settings, any static homepage. It&#8217;s called a configuration plan and it&#8217;s the part that gets forgotten.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">There&#8217;s no need to freeze content: what is published on production during these months stays on production, and will be in the final clone. That&#8217;s the advantage of this approach compared to a migration with data changing on both sides.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Phase 5 \u2014 The go-live<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Two independent operations, which can be prepared in advance except the last one.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Prepare \/site2\/ on the production domain as a 1-to-1 copy of \/site1\/.<\/strong> It&#8217;s not a style preference: a half-WordPress doesn&#8217;t open, and a folder containing only the new theme has no core, no wp-content and no media. So you start from a complete copy \u2014 core, themes, plugins, mu-plugins, wp-content\/uploads, wp-config.php to be replaced \u2014 via compressed archive from the file manager or SFTP. It&#8217;s also the safest route: any file forgotten in a partial copy shows up as a white screen on cutover day.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On this base you overlay the changes: the new theme folder, the updated plugins, the mu-plugins, the custom PHP files. If you developed everything on staging, those files are already there and you only upload the touched folders.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>wp-config.php must be replaced<\/strong> with the one for db_site2, and the protections (basic auth and noindex) must be active from the first upload: a public folder without a password can be found and indexed within hours.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>On uploads the rule concerns direction, not quantity.<\/strong> wp-content\/uploads is the only folder that grows as a result of the production site: editors&#8217; images, clients&#8217; files, attached PDFs. It must always be synchronized from production to \/site2\/, never the other way. That&#8217;s why a 1-to-1 copy made today is old tomorrow: at cutover, right after cloning the database, do a final sync of uploads with the SFTP client, set to skip identical files and overwrite only the more recent ones.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Create an empty db_site2<\/strong> from the panel: its credentials go in \/site2\/wp-config.php.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>At the last moment, clone the production data into db_site2:<\/strong><\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>export db_production from phpMyAdmin;<\/li>\n\n\n\n<li>import into db_site2;<\/li>\n\n\n\n<li>with Better Search Replace (now installed on \/site2\/), replace once:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Search<\/th><th>Replace<\/th><\/tr><\/thead><tbody><tr><td><a href=\"https:\/\/example.com\/sito1\" target=\"_blank\" rel=\"noopener\">https:\/\/example.com\/sit<\/a>e1<\/td><td><a href=\"https:\/\/example.com\/site2\" target=\"_blank\" rel=\"noopener\">https:\/\/example.com\/site2<\/a><\/td><\/tr><tr><td><a href=\"http:\/\/example.com\/sito1\" target=\"_blank\" rel=\"noopener\">http:\/\/example.com\/sit<\/a>e1<\/td><td><a href=\"https:\/\/example.com\/site2\" target=\"_blank\" rel=\"noopener\">https:\/\/example.com\/site2<\/a><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>clear cache, delete wp-content\/cache\/, regenerate the page builder CSS if you use one.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Done this, db_site2 contains today&#8217;s real data with the right URLs. And db_production is still intact: \/site1\/ continues to work exactly as before. This is your rollback, not an archive somewhere.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The actual cutover lasts a few seconds:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>remove the protections from \/site2\/ (basic auth, noindex header, mu-plugin);<\/li>\n\n\n\n<li>add the redirect in the root of <a href=\"https:\/\/example.com\/\" target=\"_blank\" rel=\"noopener\">example.com<\/a>:textRewriteEngine On RewriteRule ^site1$ \/site2\/ [R=301,L] RewriteRule ^site1\/(.*)$ \/site2\/$1 [R=301,L]<\/li>\n\n\n\n<li>move \/site1\/ outside the web root, or rename it site1-archivio-2026-11-19. Don&#8217;t delete it: as long as the folder exists with its WordPress, the redirect coexists with a still-servable site and the two behaviors step on each other;<\/li>\n\n\n\n<li>complete the configuration plan on \/site2\/: activate the new theme, fix menus and widgets, check permalinks.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If something doesn&#8217;t work, the rollback is: remove the redirect, put \/site1\/ back in place, and the old site is back online with its database never touched.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 6 \u2014 Hardcoded links and redirects<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Better Search Replace fixes the database. It doesn&#8217;t touch the rest: URLs written inside a theme PHP template, inside a JavaScript file, in a canonical generated by a custom module, or left in a field that no one interpreted. These are hardcoded links, and to the server they are requests to paths the new site no longer serves: without an explicit rule they return 404.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>.htaccess works before WordPress:<\/strong> it costs almost nothing, covers any origin of the request, and doesn&#8217;t require PHP to start.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 1 \u2014 from the old folder to the new one.<\/strong> In the root of <a href=\"https:\/\/example.com\/\" target=\"_blank\" rel=\"noopener\">example.com<\/a>, not inside \/site2\/:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteRule ^site1$ \/site2\/ [R=301,L]<br>RewriteRule ^site1\/(.*)$ \/site2\/$1 [R=301,L]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The first line covers the address without a trailing slash, which otherwise doesn&#8217;t match the pattern with (.*).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 2 \u2014 slugs changed during the rebuild.<\/strong> For a few dozen URLs:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Redirect 301 \/site2\/old-page\/ \/site2\/new-path\/<br>RedirectMatch 301 ^\/site2\/services\/([^\/]+)\/?$ \/site2\/consulting\/$1\/<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">RedirectMatch with a capture group is needed when only part of the path changes. Beyond a hundred URLs, switch to the Redirection plugin with CSV import and leave only the structural rules to .htaccess.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 3 \u2014 staging is still reachable.<\/strong> It must be redirected, otherwise two copies of the site exist:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteCond %{HTTP_HOST} ^staging\\.example\\.net$ [NC]\nRewriteRule ^ https:\/\/example.com%{REQUEST_URI} [R=301,L]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Case 4 \u2014 www and HTTPS, if you didn&#8217;t already have them:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RewriteCond %{HTTPS} off [OR]\nRewriteCond %{HTTP_HOST} ^www\\. [NC]\nRewriteRule ^ https:\/\/example.com%{REQUEST_URI} [R=301,L]<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Three practical rules:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>order matters:<\/strong> redirects go before the WordPress block and end with [L], otherwise WordPress responds 404 before your rule is evaluated;<\/li>\n\n\n\n<li><strong>301, not 302:<\/strong> the 301 consolidates, the 302 transfers nothing;<\/li>\n\n\n\n<li><strong>check from your computer:<\/strong> <code>curl -sI https:\/\/example.com\/site1\/some-page\/ | head -4<\/code> must show a single 301 with the final Location.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Without SSH you don&#8217;t have grep on the server, but you can search for hardcoded URLs by downloading wp-content\/themes and wp-content\/plugins to your computer and using an editor&#8217;s search (VS Code: Search in folder). Search for <a href=\"https:\/\/example.com\/site1\" target=\"_blank\" rel=\"noopener\">example.com\/site1<\/a> and <a href=\"https:\/\/staging.example.net\/\" target=\"_blank\" rel=\"noopener\">staging.example.net<\/a>: what you find must be corrected in the files, not just redirected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Redirects don&#8217;t fix wrong canonicals nor links in emails already sent: they are a safety net. Links left in content are found like this, from phpMyAdmin:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SELECT ID, post_title FROM wp_posts WHERE post_content LIKE '%example.com\/site1%';<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Phase 7 \u2014 After go-live<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>sitemap submitted to Search Console, robots.txt without forgotten <code>Disallow: \/<\/code>;<\/li>\n\n\n\n<li>valid TLS and no mixed content (the browser console flags every HTTP resource);<\/li>\n\n\n\n<li>contact forms and transactional emails working, with a test send: this is where you discover the leftover no-mail mu-plugin;<\/li>\n\n\n\n<li>WordPress cron active, otherwise scheduled posts don&#8217;t go out (WP Crontrol);<\/li>\n\n\n\n<li>write permissions on wp-content\/uploads;<\/li>\n\n\n\n<li>if there&#8217;s WooCommerce: gateway in production mode, not test;<\/li>\n\n\n\n<li>DNS TTL back to normal value.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Leave staging up for a week with protections active: it&#8217;s needed for comparisons. Then turn it off. \/site1-archivio can be deleted after a few days, but only after the redirect has proven to work and the production database has been archived elsewhere.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The mistakes that always happen<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Exporting the database from staging instead of production.<\/strong> In this scenario the good data is only on db_production: cloning staging means bringing two-month-old content into production and the URL replacements made for the laboratory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Overwriting wp-content\/uploads with the staging ones.<\/strong> Production images are data: the latest uploads would disappear.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Forgetting that theme and plugins have settings in the database.<\/strong> The files arrive, the site opens with the new theme and with menus and homepage to redo. It must be anticipated, not discovered.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Replacing URLs with UPDATE &#8230; REPLACE().<\/strong> It breaks serialized options without giving errors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Leaving WP_HOME and WP_SITEURL in wp-config.php.<\/strong> The database is updated but the site still points elsewhere, and it takes an afternoon to figure out why.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Deleting \/site1\/ immediately.<\/strong> It&#8217;s the rollback: as long as the folder and db_production exist, going back costs a minute.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The case: a WordPress site at https:\/\/example.com\/site1\/, to be rebuilt and published at https:\/\/example.com\/site2\/, on hosting without SSH access. The rebuild concerns only WordPress: theme, plugins, templates, PHP. The content is not touched: posts, pages, media, users and comments are and remain the production ones. This is not a content migration; it&#8217;s a code release [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"full-width-page-template.php","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/www.netlabor.it\/?p=215","footnotes":""},"categories":[6,12],"tags":[8,13],"class_list":["post-351","post","type-post","status-publish","format-standard","hentry","category-informatica","category-wordpress","tag-informatica","tag-wordpress","en-US","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/posts\/351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/comments?post=351"}],"version-history":[{"count":3,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/posts\/351\/revisions"}],"predecessor-version":[{"id":357,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/posts\/351\/revisions\/357"}],"wp:attachment":[{"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/media?parent=351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/categories?post=351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/tags?post=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}