digitalquery/wp-vagrant

Existing wp install

Closed this issue · 2 comments

Hello,

I am trying to test out importing an existing wordpress install. I'm a bit confused by the import_site_domain. Shouldn't this be the same thing as the "hostname" in the settings? When I enter this as the same name as the hostname at the top of settings.sh, I get an error:

==> default: Error: The site you have requested is not installed.
==> default: Run `wp core install`.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Assuming the database for the site is "blah.dev", I've change the hostname to be "blah.dev", the import_site_domain to be "blah.dev", and the Vagrantfile config.vm.hostname to be "blah.dev". Am I doing something wrong?

I've also noticed if I leave the import_site_domain blank, I don't get any errors but going to blah.dev on my browser will prompt me to do a new wordpress install.

import_site_domain is used if you want to initially import a database from a different domain.

For example, if your production site is https://example.com, and your vagrant hostname is https://example.dev and you have a database dump from your production site, then setting import_site_domain = https://example.com means that a search and replace is performed to change https://example.com to https://example.dev

If you're trying to point to an existing WP install then in settings.sh

  • install_wordpress = false
  • import_database = true. Make sure you have your database dump as a .sql file in the wp-vagrant folder
  • import_site_domain = ''
    That will import the db dump file in the wp-vagrant folder and you should have a functioning WP-Vagrant setup.

Got it!