I moved a Craft 3 site to a new server. The previous server was a plain vanilla Ubuntu 16 LTS LAMP stack. The new web server is a Bitnami Ubuntu 16 LTS with a LAP stack (no local MySQL). In the new environment I have setup the Craft 3 site to connect to the remote server via SSL. The SSL connection seems to be working fine, but I am getting the following error when I navigate to the site on the new server:

An Error occurred while handling another error:
craft\errors\SiteNotFoundException: No primary site exists in /opt/bitnami/apache2/vhosts/ijm.org/htdocs/vendor/craftcms/cms/src/services/Sites.php:422
Stack trace:
#0 /opt/bitnami/apache2/vhosts/ijm.org/htdocs/vendor/craftcms/cms/src/web/Request.php(1120): craft\services\Sites->getPrimarySite()

I have tried adding a siteUrl setting in the general.php file, but that didn't help.

Does anyone have any ideas on how to fix this issue?


2 Answers 2


I was able to resolve this issue by reimporting the database.

  • Welcome to the Craft CMS Stack Exchange Shannon, and thanks for returning to post an answer! :)
    – Matt Stein
    Jan 31, 2019 at 23:10

Anyone else who ends up here - I just got this error while updating a Craft 2 site to 3. I fixed it by running ./craft migrate/all. Looks like it works in the CLI but not the browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.