Back

Migrating self-hosted from one server to another

  • 0
  • Self Hosted
  • General
kathelia.dokgu
5 Apr, 2024, 20:43

Are there any guides on what I need to do if I have a self-hosted instance of Appwrite on a server to another server? It'll be the same OS so there shouldn't be any issues regarding that. The only concern that I have is that currently, I run Appwrite behind Nginx Proxy Manager (NPM) but I won't need to use NPM where I'm moving it to because I'm using Cloudflare Tunnels (cloudflared) instead.

TL;DR
Developers migrating a self-hosted Appwrite server discuss various methods, including a YouTube tutorial. Issues with timeouts, memory limits, and internal routing are mentioned. Errors during migration are troubleshooted, with one developer suggesting backing up and restoring the entire server. The built-in migration tool's functionality is explained, and options like domain pointing and VPS gateways are discussed. In the end, a method of migrating data through instances' accessibility is suggested, along with a caution to test backup and restore before proceeding.
ideclon
15 Apr, 2024, 00:55

Yeah, the logs tab isn't particularly helpful

kathelia.dokgu
15 Apr, 2024, 00:57

Okay I'll try the backup from the video next weekend. I don't think I have time for the rest of the day to work on this.

kathelia.dokgu
15 Apr, 2024, 01:17

So I watched the logs for the appwrite container and retried the migration again and this is what kept showing up:

TypeScript
2024-04-15T01:13:55.021804552Z [Error] Timestamp: 2024-04-15T01:13:55+00:00
2024-04-15T01:13:55.021828584Z [Error] Method: POST
2024-04-15T01:13:55.021832334Z [Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents
2024-04-15T01:13:55.021834952Z [Error] Type: Appwrite\Extend\Exception
2024-04-15T01:13:55.021837456Z [Error] Message: This domain is not connected to any Appwrite resource yet. Please configure custom domain or function domain to allow this request.
2024-04-15T01:13:55.021839959Z [Error] File: /usr/src/code/app/controllers/general.php
2024-04-15T01:13:55.021842301Z [Error] Line: 59

For the new server, I will be pointing a domain name to it that is publicly accessible but I had to temporarily change the _APP_DOMAIN and _APP_DOMAIN_TARGET because the migration request keeps timing out (I am using Cloudflare Tunnels) after 100 seconds - https://developers.cloudflare.com/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#error-524-a-timeout-occurred

kathelia.dokgu
15 Apr, 2024, 01:29

The built-in migrations tool finally worked after I also supplied value to the _APP_DOMAIN_FUNCTIONS environment parameter (it was initially blank).

ideclon
15 Apr, 2024, 01:29

Interesting - that shouldn't affect this, I don't think

kathelia.dokgu
15 Apr, 2024, 01:29

However, it does change all of the dates to the current date and I don't want that so I'll look into manually doing the backup and restore.

ideclon
15 Apr, 2024, 01:30

CF tunnels is great - that's what I was using originally, but it was really limiting for Function domains, because of how some of it's internal routing works

kathelia.dokgu
15 Apr, 2024, 01:30

I tried it on a smaller project. But I'll try it on the main project now. I'm just testing stuff right now and it's fairly easy to start from scratch.

ideclon
15 Apr, 2024, 01:31

Yeah, I warned about that earlier

kathelia.dokgu
15 Apr, 2024, 01:32

Yes, I'm actually not that happy with CF Tunnels.. my apps have been a bit more sluggish because of it but I understand why, but I don't know of any other solution to point domain names to the dynamic IP address of the mini PC I have serving all of these Docker containers.

ideclon
15 Apr, 2024, 01:33

Sure. I personally handle it by having a VPS running Traefik forwarding requests to my local machine over Tailscale

ideclon
15 Apr, 2024, 01:34

There's also ngrok, which is a service that'll handle exposing it on whatever domain you want for you

kathelia.dokgu
15 Apr, 2024, 01:35

I want a solution where I won't have to rent a VPS.. that's the main reason why I'm trying to migrate all of my services from a Google VM to a mini PC at home. I just want everything to be in-house.

kathelia.dokgu
15 Apr, 2024, 01:35

Is this similar to CF tunnels?

ideclon
15 Apr, 2024, 01:35

Or Tailscale can expose your port directly to the Internet by itself, but then you don't have control over the domain

ideclon
15 Apr, 2024, 01:36

Yes, fairly. I've never used it myself though - I just know it exists (I have used ngrok for temporary tunnels to expose an application I'm working on locally to the web on a randomly generated domain)

ideclon
15 Apr, 2024, 01:37

Understood - having a cheap gateway VPS (I pay ~€3.50/month for mine) does put you far more in control of your whole stack, though

ideclon
15 Apr, 2024, 01:38

I also have mine handle a bunch of caching for static files (like JS, CSS, etc)

kathelia.dokgu
15 Apr, 2024, 01:40

Interesting.. I think your solution is a little too advanced for my knowledge, maybe someday I'll look into it but right now I'll just try to live with CF tunnels.

ideclon
15 Apr, 2024, 02:13

If it works for you, great! And if you want to try to get set up with a VPS gateway, I’d be happy to help.

kathelia.dokgu
15 Apr, 2024, 02:15

Thanks, let me add you so I can hit you up if I decide to go that route someday.

kathelia.dokgu
27 Apr, 2024, 21:47

I finally managed to migrate Appwrite to my new server using the method shown in the YouTube video. Thanks!

D5
27 Apr, 2024, 22:00

Oh, great! Glad it helped. I was busy recently and lost your other messages 😓

D5
27 Apr, 2024, 22:00

Can I mark this as solved now?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more