[SOLVED] How to move all the functions from local to server? How to persist execute access?
- 0
- Web
- Databases
- General
- Self Hosted
- Functions
I have two questions actually.
- When I am changing something on appwrite functions and deploying, each time the Execute Access is getting reset. How to stop that and persist the choice I have chosen once?
- I have created couple of functions and each function has a list of environment variables. Now, what's the way to move these functions from my local to my server's appwrite instance? Do I have to init all of these functions on my server again? Also, how can I copy the local database, user, etc. to server as it is.
- Did you add the execute permissions to the appwrite.json?
- You can develop locally and use the CLI to deploy to the server. You can also use the CLI to deploy the collections to your server.
- No. I have changed through console.
- Is there any documentation on that?
@Steven I need a documentation to move my collection, functions and database from local to server. Do you a documentation on that? As a beginner I expect this from the official documentation.
- You'll need to add it to the appwrite.json instead.
- We have docs for the CLI: https://appwrite.io/docs/command-line-deployment
And here are docs on how to change the instance you're connected to: https://appwrite.io/docs/command-line-ci#configuration
- You should add that in the documentation.
- What will CI mode do? appwrite client
\ --endpoint https://[HOSTNAME_OR_IP]/v1 \ - Is this the server endpoint? --projectId [YOUR_PROJECT_ID] \ - Server Project ID? --key YOUR_API_KEY - Server API key? After this what should I do? The documentation you referred are only discussing different config options you have but not a continuous process. Can you describe me the full process of migrating one collection from my local to my server?
- https://appwrite.io/docs/command-line-deployment#avoidingConflicts
- Whoops that link shouldn't be to ci mode (@VincentGe, looks like the link for the configuration header is incorrect). @shofol you can change your endpoint to point to the new server and then deploy everything in your appwrite.json
oh yeah we moved it. Let me open a PR
@Steven - About this - "you can change your endpoint to point to the new server and then deploy everything in your appwrite.json" - Where should I change it? In the server?
Please help me with a proper step by step procedure as I am totally beginner to Appwrite, Docker, etc. So, 1. I will install Appwrite CLI to server and set the endpoint to that server. 2. Then how will I upload my local functions and collections to that server? I am confused in this part. From local what is the procedure to deploy to my server? Where should I change to tell the CLI to deploy the collections and functions to server not my local machine. Please, clarify this step. I am not understanding by reading the official documentation. The documentation assumes we have good knowledge of backend terminologies.
#2 here is how you would change what instance you're connecting to
You don't need to install the CLI on the server.
Have you carefully read through all the CLI docs?
Yes, I have read it but as I said I am new so the documentations seems hard for me. Let's say I am not understanding what CI mode is. Let's say here it's saying - You can enable CI mode for the Appwrite CLI by setting the project ID, endpoint, and API Key: Now it's not clear which project id, endpoint or api key should I use here.
Is doing the CI mode enough? And, if I start the CI mode which appwrite.json will it use?
sorry, ignore CI mode.
You've got your appwrite.json locally and you've connected to your local instance. Now, you can run this: https://appwrite.io/docs/command-line#configuration to point to your other server instead of your local server and then run the usual appwrite deploy collection
and appwrite deploy function
. Instead of deploying to your locally server, it will deploy to your other server because of the configuration change
Now it's clear. Thank you very much @Steven. I will try and let you know. I think you should have some example projects/ tutorials in the documentation for the beginners like me. It would be easier for us to find a solution easily there rather than posting similar issues again and again here.
[SOLVED] How to move all the functions from local to server? How to persist execute access?
Recommended threads
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- Custom Domains
Hi All, Should be a quick config issue. I'm setting up custom domains on the hosted version. I have verified the domain with the CNAME but appwrite isn't gene...