How to move Kirby to a new host?

Brand new to Kirby. Currently, live in the WordPress world but we have a client with a Kirby site that wants to move to us from another guy. It looks like since there is no database it should be as simple as moving the files over and then going through the process to upgrade from V2 to V3 is there anything else to it than that that I am missing?

welcome to the forums. :confetti_ball:

the docs explain the required steps:

i would recommend to read the local development guide as well.

but feel free to ask questions if you need any help.

Yes, that’s right. You have to make sure that the new host fulfills the requirements for Kirby 2 (and if you upgrade, those for Kirby 3 as well).

You can find the Kirby 2 documentation here: http://k2.getkirby.com

Note that the biggest step when upgrading to Kirby 3 concerns plugins. Therefore I’d recommend you check what sort of plugins or extensions are present in the old installation to check if these have been upgraded to work with Kirby 3 or if there are alternatives.

Ok I am trying this out. I moved a copy of the site from the old host to a test URL on the new host. I can get the homepage to come up (even though none of the scripts are loading or css) and when I click on any of the links they also give a 404.

So if my test URL is http://111.222.333.444/~testsite/ all of my scripts and URLs seem to be loading without the ~testsite part of the url. I have even set this in the config.php file
c::set(‘url’, ‘http://111.222.333.444/~testsite’);

Not sure where I am going wrong here.

Have you also copied over the .htaccess file?

If you haven’t, make sure to copy that file as well.

If you have and links to subpages do not work, then make sure that rewriting is enabled on the new host. Also make sure that the new host accept htaccess overwrites. You can test this by putting some garbage into the .htaccess. If the site still works afterward, then that’s a sure sign the server doesn’t even read the file.

Yes the .htaccess file was copied over and I am able to overwrite the file. I verified this all with the host. Any other ideas?

Have you tested putting garbage into the .htaccess like I suggested? If the home page works but subpages don’t, then rewriting just doesn’t work.

So basically you are just saying put something like 324532rfgdsfg34wtefg in the .htaccess file anywhere and save it then see if the homepage even shows up?

Exactly!

Tried that and no change but according to the hosting company "The .htaccess will ignore comments and any erroneous text in it and continue looking for rules inside the file. "

Have you tried setting the Rewrite base in your .htaccess to the subfolder your project is in?

RewriteBase /~testsite

Good idea I had not thought of that but it doesn’t seem to make a difference. The console

still shows a bunch of 404s for everything.

The page links are all pointing to the right place it is just all the assets like the css and the js that are only using http://66.201.69.45/ instead of http://66.201.69.45/~testsite/

Try to set the URL in your config.php

c::set('url', 'http://66.201.69.45/~testsite/');

Ah, you said above that you already tried that.

Hm, do you have any htaccess files in the parent folder that might interfere?

You could also try to set a subdomain to that subfolder.

I think I may have found the solution to this actually. Everywhere it calls a CSS or a JS it was referencing it like this src="/assets/ so when I replace all of those to src="assets/ all the content starts loading correctly. I assume this has something to do with a difference between how the Litespeed server handles those directory paths than the previous host did?

I would recomment you use the css() and js() helpers instead of using relative links, that way you don’t run into those issues.

http://k2.getkirby.test/docs/archive/v2
http://k2.getkirby.test/docs/archive/v2

1 Like

I’m still running into some issue with some of the pages. I’ll see if I can get them working. If not I’ll be sure to post here again. Thank you for all your help so far.

Only with the assets? Or subpages not working?

Some of the subpages. Apparently they use some sort of tags. So this is the actual test site URL.
http://66.201.69.45/~fivepointscolumb/
Then if you navigate to the Eat page at the top. Then click one of the tags you get a page like this
66.201.69.45/~fivepointscolumb/restaurants/tag:food
These pages are still not working.
I am basically trying to get this site working like it does on the other server (see http://www.fivepointscolumbia.com) before we move the domain name. Since this is our first time working with a Kirby site we are sort of wading through it.

They all use relative links, but changing this in the header snippet or any other snippets used in the templates should finally make it work?