We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Deploying a Wordpress localhost website to web
Options

roytom2
Posts: 161 Forumite

in Techie Stuff
I’ve been developing a Wordpress based website on a laptop using a localhost server. It’s my first attempt and I’ve used YouTube vids to learn it gradually.
All’s well and I was ready for deploying it to my actual website. The Duplicator plugin was recommended, which I’ve used in the past to copy my draft site from one laptop to another - again using localhost.
But when I copied the Archive.zip and Installer.php files to my site, using FileZilla, things didn’t work well. The Duplicator installer starts ok but always falls over at the 2nd stage, install database. Neither create new nor connect to existing database work. Yet as the first stage of the installer works all the files in the archive are unpacked onto the website.
All’s well and I was ready for deploying it to my actual website. The Duplicator plugin was recommended, which I’ve used in the past to copy my draft site from one laptop to another - again using localhost.
But when I copied the Archive.zip and Installer.php files to my site, using FileZilla, things didn’t work well. The Duplicator installer starts ok but always falls over at the 2nd stage, install database. Neither create new nor connect to existing database work. Yet as the first stage of the installer works all the files in the archive are unpacked onto the website.
Therefore, I can see my database (using FileZilla) - but if I was to connect to this the installer says all the data would be deleted. The database is filled with several megabytes of data.
But when I use Duplicator to move the site from one laptop to another it works perfectly *providing I create an empty database first* using the php admin software.
Any ideas?
thanks
But when I use Duplicator to move the site from one laptop to another it works perfectly *providing I create an empty database first* using the php admin software.
Any ideas?
thanks
0
Comments
-
Is the database on the server set up correctly for the Wordpress blog? Have you changed the parameters in Wordpress to reference the server database rather than your local one, and have you set up a user and password on the server database and added these parameters in the Wordpress setup?
It’s difficult to know exactly what process you have gone through from your post. I migrated a local Wordpress installation to a server last year, but I can’t remember the exact steps. The gist of it was to set up the database with the appropriate user and password, upload all the files to the server then run wp-admin to install Wordpress and connect to the database, but there were parameters as mentioned above that needed to be changed first, and it took a bit of tweaking to get it working.
I found the following articles to be helpful:
https://wordpress.org/support/article/how-to-install-wordpress/
https://wordpress.org/support/article/before-you-install/
These may or may not help in your situation, but they certainly helped in my case when I needed to tweak settings to get it all to work.Retired at age 56 after having "light bulb moment" due to reading MSE and its forums. Have been converted to the "budget to zero" concept and use YNAB for all monthly budgeting and long term goals.1 -
This may be because you've told Wordpress offline to use the local IP address to find the database - 127.0.0.1 - as opposed to "localhost". 127.0.0.1 doesn't exist on a web server (or rather it does, but not in the same way it does with your offline setup).The other alternative of course is that the database name you've set up offline doesn't match the online one.2
-
I feel like this is going to depend on your web host.If the web-host is supporting multiple wordpress installations, they could have carved up the databases in any number of ways to support multiple tennents. They could run multiple instances, multiple databases, or one big database using role/user permissions model to segregate access to database objects between the tennents.The database server may not necessarily be on the web server either. It could be a seperate dedicated host or cluster, so not necessarily 'localhost' / '127.0.0.1'.You need to know how your web hosting environment is setup and probably, somehow, reflect that in the setup of the duplicator plugin.Alternatively, you might find it beneficial to switch to a content management system that relies solely on static files, rather than a database. This simplifies hosting/deployment/backing up somewhat. In fact, it means you could put the source files for the website into GitHub and use DigitalOceans app platform to serve up the site. You can configure this to point directly at the GitHub repository for your website. I find GravCMS is a good alternative to WordPress, but there are others.Neil_Jones said:This may be because you've told Wordpress offline to use the local IP address to find the database - 127.0.0.1 - as opposed to "localhost". 127.0.0.1 doesn't exist on a web server (or rather it does, but not in the same way it does with your offline setup).It is not a defined standard. It can be any address in the loopback range (127.0.0.1/8), if supported by the OS. It is unusual though. It is possible that a host may setup a web server with a local database which has multiple instances running on different addresses in the loopback range.
Also, MySQL will use a unix style socket when 'localhost' is used for a connection. To use a TCP socket, you have to use '127.0.0.1' in the connection string. I'm not sure whether this is the same for MariaDB which is oft used instead of MySQL.
A dream is not reality, but who's to say which is which?1 -
I think it's more webserver/config side causing the problems
Webhost configuration will be different. You could create a new installation of Wordpress and then upload the database files through PhPMyAdmin for your local copy. Then just import the content of the files.
Alternatively upload your files, then change the database name/db password in the configuration file as needed so it points to the new database detailsOwner of andrewhope.co.uk, hate cars and love them
Working towards DFD
HSBC Credit Card - £2700 / £7500
AA Loans - (cleared £9700)1
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 350.8K Banking & Borrowing
- 253.1K Reduce Debt & Boost Income
- 453.5K Spending & Discounts
- 243.8K Work, Benefits & Business
- 598.7K Mortgages, Homes & Bills
- 176.8K Life & Family
- 257.1K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards