After about 3 months, my site is nearly finished. I successfully moved it from my laptop to a different computer.

I cannot get it to deploy to the live site.

I followed the directions in the docs:

Moved all my files to the live site.
Created a database on the live site.
Ran the installation process.
Enabled all the same modules.
Imported the configuration files

-- all worked so far --
Imported the database exported from the local site.
Then the site goes back into installation mode.

Finally got around that (i can't remember exactly how I did that), but none of my content is there.

Then I did another export from the localsite (via backup & migrate) and tried to import that into the live site and I get this message:

"Unable to restore from file /tmp/backup_migrate_ykRSd7 because a file can't be restored to this database. Could not perform the restore."

Been back and forth with this for 2 days - Thought I should ask for suggestions before giving up.

 

 

 

 

Accepted answer

Hi DanM...,

Do you have access to the control panel on the web host?

Do you have access to phpMyAdmin?

I've found that restoring the DB via the admin panel is more successful.

What I normally do is just copy all of the files from my local site to the hosting site and then import the DB via phpMyAdmin... and that's it... You don't have to run the Install... if you do, it will wipe the old data.

Hope this helps.

Steve

Comments

Hi DanM...,

Do you have access to the control panel on the web host?

Do you have access to phpMyAdmin?

I've found that restoring the DB via the admin panel is more successful.

What I normally do is just copy all of the files from my local site to the hosting site and then import the DB via phpMyAdmin... and that's it... You don't have to run the Install... if you do, it will wipe the old data.

Hope this helps.

Steve

Right. Do not pre-install the site or run install. Just fully copy the backdrop installation folder, and the database with phpmyadmin before opening the site. Although there are other ways, I do this this way all the time.

After you have the site working you will most likely need to adjust the location of the public, private, and temp file folders under Configuration > Media > File system

Are you on Zulip? If you post there people can probably help with this as well.

Thanks. I'll check out Zulip. Best I can get is a white screen.  http error 500.

I've tried everywhich way to enter the database in settings.php:

$database = 'mysql://muranod_root:PASSWORRD@localhost/muranod_backdrop2023';

(tried backdrop 2023 alone)

$database_prefix = 'bkdrop2023_';

(tried: _muranod_bkdrop2023_ ,  muranod_bkdrop2023)

DanM, there is no need to use a database_prefix. That's usually left as '', unless the same database is being used by other installations, which is very unusual.

I would check that:

  1. Your domain is pointing at the correct folder in the server
  2. Your database user is really "muranod_root" and it has the necessary privileges
  3. Your password is correct
  4. Your database is really called "muranod_backdrop2023". Check with phpMyAdmin that this is the  correct name. Is this shared hosting?
  5. That you have set the $settings['trusted_host_patterns'] setting in settings.php correctly, to allow the domain to access the site

Typically, you'll get an installation screen when Backdrop can't find an installation database, or when the database is empty.  

Thanks for the suggestions, argiepiano. I had not set the trusted host patterns. I thought I could do that after the site was live. - I'll check those settings.

I showed the database string to a tech at my hosting provider and he verified that it was correct. I dropped the database prefix and copied to site to another local computer and it worked and set the live site up similarily. The tech didn't seem too certain though, and upped the support level.

The next text who looked said to find a developer. Obviously, not helpful. Also, while I was trying some of the above stuff, I didn't know that my IP had been blocked, so much of what I tried was moot.  :-(

On the live server, the folder for this site is below the folder for the D8 site that's been there for a long time. I'm wondering if that somehow affects the path, though I would think the tech would have said so. The domain name is set (by the same host) to point directly to that folder.

That said, I did try direct installations and they worked. I then used the same database path with the original files and again, it didn't work. The site that's been there in a folder above still works fine.

Not giving up yet. Thanks again for your suggestions.

 

Finally had success hooking the site up to the database, which I had recreated minus some special password characters.

Next step is to figure out how to get all the custom fields and views to show up. I found a helpful post on configuration for that, but can't get to it for a day or so. I'm pretty sure that's where I'll find and fix the problem.

Backdrop was more complicated in migration than my original d7 site, but I'm  happy I decided to use it. One simplification that made it more difficult for me was having the database info all on one line rather than laid out line by line as in D7 / D8. With that info on multiple lines, it was easier to spot any mistakes.  Not sure why it so easily moved to different computers but was not so easy to do onto a live server.  Appreciate all the help (and patience!) from everyone here.

-DanM

Hi DanM

You can use the old array style for database credentials and I find it is necessary when defining complex passwords as the single line breaks with certain characters.

Here's an example:


$databases['default']['default'] = array(
  'driver' => 'mysql',
  'database' => 'cpuser_bd_live',
  'username' => 'cpuser_bdlive',
  'password' => 'V€ryC0mplexP@$sw0rd#:2023@',
  'host' => 'localhost',
  'port' => '3306',
  'prefix' => '',
);

There is an issue to fix this at https://github.com/backdrop/backdrop-issues/issues/2231

This is what we're hoping to get to:

/**
 * Database configuration:
 *
 * Most sites can configure their database by entering the connection details
 * below. If using master/slave databases or multiple connections, see the
 * advanced database documentation at
 * https://api.backdropcms.org/database-configuration
 */
  $database = array(
    'driver' => 'mysql',
    'database' => 'databasename',
    'username' => 'username',
    'password' => 'password',
    'host' => 'localhost',
    'prefix' => '',
  );

I think that the array format would have saved me a lot of time - it's a bit more difficult to make mistakes with everything so clearly laid out.

Great! Regarding views and fields: those are stored as configuration files in Backdrop. It's very easy to move them to another site. You can do a global export in your original (dev) site by going to admin/config/development/configuration/full/export

That will export all your configurations as a zip file. Then in your production site, go to admin/config/development/configuration/full and choose the zip file you just created. That's it.

There are other ways to do this. You could copy the content of a single config file (e.g. a single View) in Configuration > Development > Configuration manager > Single export, and import it in the other site in the same menu.

Or you could do this with git push and then pull files into the files/config_XXX/staging directory of your production site and then going to Configuration > Development > Configuration manager > Synchronizing

More info: https://docs.backdropcms.org/documentation/working-with-configuration 

Thanks. I did export/import, but got a lot of errors. From what I've been reading, I understand that it may be from the order - the config files were already there when I uploaded the database.  (It's a 2020 article, so I guess that still holds true?)

In any case, the site isn't huge, so it's no issue to drop the database, remove the config files, upload the database, check modules, delete any content, then import the config files, if that sounds right.  I'll examine the link you posted.

My Backdrop experience so far is that setting up the local site and configuration wasn't so different from D7 / D8 - and an enjoyable exercise in logic. Design was challenging finding the classes to override. (No Display Suite to inject field classes). Deployment seems the toughest part for me.  The Backdrop community has been a huge help in overcoming obstacles.