Hello,

Preface: I'm not much of a developer and more of a Designer. I haven't been working in Drupal lately since they made Composer mandatory since it just didn't work with my Godaddy account ( they didn't offer the necessary PHPmyAdmin or PHP version required nor did they offer composer) so I've been working in other CMS platforms like dotnetnuke and Wordpress. Problem is, I really don't like those platforms and love the Drupal platform. When I heard that Drupal was coming out with Drupal CMS I was excited and redesigned my sites with it.

The Problem: I'm ready to migrate my local sites to my new hosting provider (Hostinger since it was recommended on the preferred hosting providers on Drupas website) I'm using the cloud hosting. 

My local environment is Ddev, I don't respond well to the command line but sucked it up and got things working fine. 

In Hostinger they offer auto installs for all the major CMS platforms including Drupal. I installed the Drupal version 11.3.2 which is the same as my local version. The problem is, the folder structure is completely different than my local site. I'm not sure how to deal with this!!! I think the vision installed is just Drupal core and not Drupal CMS.

Is there any way to move my local files and database and get the hosted site working?

Thanks for any help with this, I'm sure you guys are getting tired on non techies like me asking these sort of questions so I appreciate any help!

Comments

jaypan’s picture

  1. Export your configuration from your local database to file
  2. Export your database
  3. Overwrite the Drupal codebase with your codebase (including the exported configuration from above)
  4. Import the database export into the remote environment database
  5. Clear the registry/cache
  6. Import the configuration from the exported configuration (it probably won't do anything, but if you have config splits, it will ensure they are respected)

Contact me to contract me for D7 -> D10/11 migrations.

tevy’s picture

Few more questions...

 

  1. Export your configuration from your local database to file - Do I need to save this to a certain location? Should I unzip the export?
  2. Export your database - I can do this via the myphpadmin right, are there any export setting I should configure?
  3. Overwrite the Drupal codebase with your codebase (including the exported configuration from above) - So I would just overwrite the local files and directories into the website's root folder on the hosting plan? What about the settings.php file? It's vastly different than the usual settings.php files since I use DDEV on local and it points to a different data base and login credentials.
  4. Import the database export into the remote environment database - I've tried doing this on my second or third attempt to transfer but got some odd error (sorry can remember the exact error) but it would't take my local import.
  5. Clear the registry/cache
  6. Import the configuration from the exported configuration (it probably won't do anything, but if you have config splits, it will ensure they are respected) - I assume I would select the file based on the answer to step (1)

     

jaypan’s picture

Do I need to save this to a certain location? Should I unzip the export?

The answer to that is longer than I can put into a comment, and something I wrote on in a former life. Slightly outdated, but still about 95% valid: https://www.morpht.com/blog/drupal-8-configuration-part-1-configuration-api

Contact me to contract me for D7 -> D10/11 migrations.

ressa’s picture

Heh, learning to use the command line can be a challenging process, but very rewarding, because it's so powerful. Luckily I found add1son's amazing Command Line Basics (Drupalize.me) tutorial back in the day, and got a great intro. It's still one of the best.

About auto-installers, they usually result in a Frankeninstall ...

It seems unnerving that Hostinger's cheapest plan ($2 per month "Premium") may explode to $13 per month after a year ... or maybe you grabbed 4 years right away. https://www.hostinger.com/pricing

There is a Hostinger doc page and issue for Project Browser, maybe with some tips?

It seems like this plan is required? https://www.hostinger.com/vps-hosting ("AI agent manages your VPS", hmm ...)

Drupal hosting for small and medium sized Drupal projects

Interestingly, the best recommendation for affordable Drupal hosting for small and medium sized Drupal projects may be 7 Best Drupal Hosting Providers for High-Performance Sites from the enterprise web host Pantheon where #4 - #7 (A2 Hosting, IONOS, Cloudways, Scalahosting) might work?

For some advanced folder structure/folder-wrangling (which may be too complex) on shared hosting, see https://www.drupal.org/docs/getting-started/system-requirements/relocate....

UPDATE: We need a doc page to help the users find Drupal hosting for small and medium sized Drupal projects, @jaypan feel free to give it a look over:

https://www.drupal.org/docs/getting-started/system-requirements/hosting-...

tevy’s picture

Hopefully the cloud hosting will work, if not Guess I could switch to VPS hosting but avoided that since I'm not really comfortable setting up my own server config.

ressa’s picture

You're welcome. And about VPS, you're right, it's more involved ...  I assumed that the Drupal guide would only recommend Hostinger VPS, if the set up was more or less automated ... but it seems like there are a lot of steps after all, like with any VPS.

You could check out the other hosting providers in the new hosting doc page, perhaps their managed hosting works better than Hostinger's?

Either way, I recommend that you go through the Drupalize.me CLI tutorial. After that, you will have learned how you can use rsync or scp to transfer the files and database to the server, set permissions, and all the rest of the very useful CLI commands.

About your questions to @jaypan, just like there is a "Checklist for launching a site" under https://www.drupal.org/docs/administering-a-drupal-site, it would be nice if there was a "Moving your site to a hosting provider" documentation page, listing out the actual basic commands from @jaypan's first comment.

tevy’s picture

Drupalize me is a bit pricey for me at this time.

Hopefully I can get things working using Jaypan's process. 

I was very close at one point, I deleted the Drupal install on hostinger and uploaded the latest Drupal CMS in its place, uploaded any files like images, themes, libraries etc to hostinger. Used the backup and migrate export. The site was up and running but but the custom content pages were just a blank screen. If I went to elite the content pages in the admin (they were all there) the page was blank. Perhaps I just needed to upload the configuration file and would have been up and running but I didn't even know that existed.

ressa’s picture

Yes, but the Command Line tutorial I linked to is on YouTube, so those videos are free.

Fantastic that you almost got it working, good luck!

Anonymous’s picture

"I assumed that the Drupal guide would only recommend Hostinger VPS"

If it did, it would be unreasonable, I think. I have used the business plan since last September and so far I cannot fault the performance or features, which are much improved over my previous provider. My site is only a minor one, admittedly, but it shows that Drupal can run very fast on shared servers.

ressa’s picture

The full quote is: 

I assumed that the Drupal guide would only recommend Hostinger VPS, if the set up was more or less automated ... but it seems like there are a lot of steps after all, like with any VPS.

Including just a snippet changes the meaning.

But great to hear you got it working! Feel free to share your observations in #3454006: Test Project Browser on Hostinger since it states that to have the server access for a proper Drupal installation, you must purchase a VPS Plan from the start.

So if Premium works, that's important information.

And feel free to add Hostinger on https://www.drupal.org/docs/getting-started/system-requirements/hosting-... under "More hosting providers with Drupal and Composer support".

Anonymous’s picture

In which case, I cannot comprehend your intended meaning; perhaps it should have been written more clearly because it appears to be at least two sentences concatenated by random punctuation.

ressa’s picture

Ok, it's too bad if it was worded ambiguously ...

But now that that's settled, you should still feel free to update the documentation, like I suggested.

EDIT: I added Hostinger under "More shared hosting providers with Drupal and Composer support"

ressa’s picture

Though, I probably shouldn't have mentioned the "Test Project Browser on Hostinger" issue in the first place, since it is not only about getting Drupal to work, but also the Project Browser and Auto Update module, which are extra requirements not everyone use.

But just to confirm: Some run Composer locally and transfer files, but do you use Composer via SSH on Hostinger's  Business plan @3rdgarrideb?

tevy’s picture

FYI: in the past with Drupal 7 my procedure was fairly easy,...

1. I would create a new data base on the hosting platform
2. Using backup and migrate, I would backup the whole site
3. Copy my local website to the hosting provider
4. Overwrite the setting.PHP with the default one
5. Go through the site setup prompt on the hosted site pointing it to the new database
6. Go into the modules and enable backupandmigrate on the hosted site
7. Upload my local site backup
8. That was it, site worked pefectly

I would be nice if Drupal could get back to something easy like that!

ressa’s picture

https://www.drupal.org/project/backup_migrate is still a thing :) I haven't tried it though. I usually export the database with DDEV, and transfer the files with rsync.

tevy’s picture

Yeah it is and I have it installed but they say backing up an entire site can mess things up so the table the option with (do not use!). They say they hope to resolve the issue but have seen no movement on that.

tevy’s picture

Hey Guys, I've reached my frustration level with trying to get this to work on Hostinger. I unfortunately don't have the expertise to try switching to the VPN plan with would require me to become a server configuration expert. 

Are there any hosting options that have been tried and tested to work with Drupal 11 CMS and support composer and project browser that require me to setup my own server?

ressa’s picture

Maybe @3rdgarrideb with Hostinger experience can help you?

@tevy: You didn't mention Project Browser originally, do you really need it? Can't you just use Composer? Project Browser adds complexity, as can be seen in the previously linked issue ...

tevy’s picture

If @3rdgarrideb could provide his process for migrating his site to hostinger it would be very helpful.

I think the major issue I’m having is that the cloud plan does not let me change the website root so they suggested and htaccess redirect to the web folder. Which made the site appear but I couldn’t get into the admin, a google search gave me a setting to add to the settings file which then let me access the admin but the outward site when Back to a 403 error.

and by project browser, I meant Configuration Editor.

tevy’s picture

I managed to get the site up and running thanks to the help of the post....

https://www.drupal.org/project/drupal/issues/2612160#comment-11767977

Comment #46 and #48 did the trick!

The only problem I seam to be having is the links to my content (a custom content type) display a blank screen. There is no error message displayed but the browser console says "Failed to load resource: the server responded with a status of 500 ()"

any idea what might be causing this?
 

ressa’s picture

Great news, and thanks for the issue link @tevy! It was very inspiring, and I updated the doc page Relocated web root on shared hosting I created a while ago, originally only covering symlink.
I added two more methods (.htaccess and DocumentRoot) and created #3569379: Add support for setting web root to /web under Basic site settings, using /web should be easier :)
tevy’s picture

@ressa I'm still not out of the woods yet. Any idea how to resolve this other issue I mentioned?

"The only problem I seam to be having is the links to my content (a custom content type) display a blank screen. There is no error message displayed but the browser console says "Failed to load resource: the server responded with a status of 500 ()"

Can't access the pages through the admin either so cannot edit them.

95% of the content on the site is a custom content type.

ressa’s picture

It's hard to tell, it could be any number of problem ... try checking the error log, or some of the suggestions in the article:

If that doesn't help, I would contact hosting support. 

tevy’s picture

I enabled PHP errors and found out there was an issue with the SVG_Image module. removed it and loaded again and everything is working as normal!!!

Thanks for all your help with this, much appreciated!!!!

ressa’s picture

Fantastic, congratulations! It's often a small thing, you would never consider. Have a great day :)

ressa’s picture

By the way, feel free to add [Solved] first in the title, to make it clear that this issue has been resolved.