You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is one I want for myself :) would love to get more community feedback before we go to implementation.
Cloning a project should also clone API Keys, webhooks, tasks, etc..? Cloning project resources (documents, files, collections) will not be scalable so we might want to skip it.
Cloning a collection would also be nice, but again without its child documents, only name, rules, permissions.
Cloning a document should be straight forward.
We could also clone a file, would this be useful?
User cloning is obviously not relevant.
Reacted by punitdiwan, GB, Maurice Bauer, xue, Deep and Nacho
Reacted by Thyago Brandão de Paula, João Carlos Pereira, Ivan and Nacho
Please create an API endpoint for cloning the project. I always wanted to have API endpoint for creating new project, by the time this request is under discussion, I suggest to have Project Cloning using API.
At the time of Cloning a project, we can pass params (in APi) or checkboxes (in console) to allow user to clone other resources like web-hooks and tasks. Collections along with rules will be cloned anyhow. As far as collection names are concerned, we can prefixed the world “cloned” with that to make it unique. Later user can rename that. For example, if the collection name is user, the cloned collection name will be clonedUser
If user wants, he can generate fresh Server API keys for the new project.
I would love to have the option to clone the whole project so I can use the production server for development stuff... For example, I might have 1M documents in a collection, and I want to delete some of them. I want to clone the whole project for testing purposes, so I am sure I will not delete anything by mistake on production. Once I am satisfied with my code, I will delete the clone and run the script on the production project.
Cloning a project should also clone API Keys, webhooks, tasks, etc.? Cloning project resources (documents, files, collections) will not be scalable, so we might want to skip it.
In my opinion, everything should be cloned, but the project should have a new ID. Hmm, so we can't clone all documents/files? Can this be an option? (toggle box). This can be done in the background and can take 5 minutes; I don't really care. Maybe an option to "clone samples" that randomly chooses some percentage of documents/files and clones them?
We could also clone a file, would this be useful?
Yes, really useful. If I need to clone the project, I expect it to work after a clone. Question tho, if we randomly cloned some documents, can we randomly clone some files? What if we clone documents referring to some image that has not been cloned?
User cloning is obviously not relevant.
Well, maybe yes. I might have 10k users, and I want to write a function to alert all users (using yet another function) that meet some conditions. I don't want to do it directly on production because I might alert the wrong users with some "hello works" message.
Another example is that I might want to ban all users who wrote more than 1000 similar comments in a comment section on my blog. I could test it in a development environment. Still, I don't have any comments data, so I am pretty much writing code blindfolded because "what should I consider a similar comment?".
With the new Appwrite CLI, you can in fact clone collections and functions with their name, permission configuration, and schema copied. All the relevant information can be set up in appwrite.json.
@bliyscom, this is possible with the Appwrite CLI or at least we're working on making it fully possible via #3449
@thyybrandao I don't think we'll go through the effort with adding a clone feature via the Console right now as it would add a lot of extra different l duplicate code that would add extra effort to maintain. For more, the best approach would be to use the Appwrite CLI. Would it be okay to close this issue since we won't be focusing on this right now?
We have been using Appwrite for some time now and we had this issue of (re)creating dev. environments when a new developer joins, or someone wishes to setup the project from scratch. There is considerable amount of time that's spent in just setting up the project, API keys, OAuth etc; The latest CLI does help with syncing the collections and functions but doesn't go beyond that.
We ended up creating our own CLI written on top of the Appwrite APIs to manage pretty much every resource Appwrite provides. But the most important feature being able to create a snapshot of the entire config and restoring/syncing it. This has helped us to reproduce the same env. on different machines very quickly - ~60s :)
This snapshots are just json files that are created in the directory where you run the command. It tries not to store any of the API keys that get generated in your system, but uses placeholders and re-creates them on newer systems. The only key that gets stored in the snapshot (in plain text) are the auth keys (Oauth) - so please make sure you are aware of this and don't check-in to public repositories.
# Install appwrite
npm install -g appwrite
# Connect the client to your original project
appwrite client --projectId ORIGIN_PROJECT_ID --key APY_KEY
# Pull all resources from original project
appwrite pull all --force
# Connect the client to your destination project
appwrite client --projectId DEST_PROJECT_ID --key APY_KEY
# Push all resources to the destination project
appwrite push all --force
You can also login using username+password+otp by running
appwrite login
Reacted by Bill.zhanxg and Luis Pedro Morales Rodríguez
Activity
eldadfux commentedon May 30, 2020
This is one I want for myself :) would love to get more community feedback before we go to implementation.
Cloning a project should also clone API Keys, webhooks, tasks, etc..? Cloning project resources (documents, files, collections) will not be scalable so we might want to skip it.
Cloning a collection would also be nice, but again without its child documents, only name, rules, permissions.
Cloning a document should be straight forward.
We could also clone a file, would this be useful?
User cloning is obviously not relevant.
punitdiwan commentedon May 31, 2020
Please create an API endpoint for cloning the project. I always wanted to have API endpoint for creating new project, by the time this request is under discussion, I suggest to have Project Cloning using API.
At the time of Cloning a project, we can pass params (in APi) or checkboxes (in console) to allow user to clone other resources like web-hooks and tasks. Collections along with rules will be cloned anyhow. As far as collection names are concerned, we can prefixed the world “cloned” with that to make it unique. Later user can rename that. For example, if the collection name is user, the cloned collection name will be clonedUser
If user wants, he can generate fresh Server API keys for the new project.
Meldiron commentedon Jul 14, 2021
I would love to have the option to clone the whole project so I can use the production server for development stuff... For example, I might have 1M documents in a collection, and I want to delete some of them. I want to clone the whole project for testing purposes, so I am sure I will not delete anything by mistake on production. Once I am satisfied with my code, I will delete the clone and run the script on the production project.
In my opinion, everything should be cloned, but the project should have a new ID. Hmm, so we can't clone all documents/files? Can this be an option? (toggle box). This can be done in the background and can take 5 minutes; I don't really care. Maybe an option to "clone samples" that randomly chooses some percentage of documents/files and clones them?
Yes, really useful. If I need to clone the project, I expect it to work after a clone. Question tho, if we randomly cloned some documents, can we randomly clone some files? What if we clone documents referring to some image that has not been cloned?
Well, maybe yes. I might have 10k users, and I want to write a function to alert all users (using yet another function) that meet some conditions. I don't want to do it directly on production because I might alert the wrong users with some "hello works" message.
Another example is that I might want to ban all users who wrote more than 1000 similar comments in a comment section on my blog. I could test it in a development environment. Still, I don't have any comments data, so I am pretty much writing code blindfolded because "what should I consider a similar comment?".
AhmedHammad0900 commentedon Nov 6, 2021
is this feature available now ?
kiloki-official commentedon Jan 13, 2022
Cloning collections and projects would be VERY useful!!!
gewenyu99 commentedon May 20, 2022
Hi there,
With the new Appwrite CLI, you can in fact clone collections and functions with their name, permission configuration, and schema copied. All the relevant information can be set up in
appwrite.json.If you wish to clone with data intact, I would maybe suggest using the backup and restore mentioned here to backup the entire deployment and restore it somewhere else: https://gist.github.com/Meldiron/47b5851663668102a676aff43c6341f7
Let me know if this covers your use case, and if not, what we're missing :D
stnguyen90 commentedon Jul 14, 2022
Possibly related issue: #491
bliyscom commentedon Sep 8, 2022
It would really be nice to be able to clone an entire project without actual files but schema and everything else. Just a change in Project Id
stnguyen90 commentedon Oct 21, 2022
@bliyscom, this is possible with the Appwrite CLI or at least we're working on making it fully possible via #3449
@thyybrandao I don't think we'll go through the effort with adding a clone feature via the Console right now as it would add a lot of extra different l duplicate code that would add extra effort to maintain. For more, the best approach would be to use the Appwrite CLI. Would it be okay to close this issue since we won't be focusing on this right now?
huy-lv commentedon Jul 6, 2023
Hey, I have built an open source tool to clone database, users, teams. Hope this help you.
https://github.com/huy-lv/appwrite-cloner
bliyscom commentedon Jul 6, 2023
gewenyu99 commentedon Jul 6, 2023
That looks amazing @huy-lv !!!
We love seeing projects like this. We love it when people create open-source tools to add to the ecosystem, awesome work.
bhagn commentedon Aug 6, 2023
We have been using Appwrite for some time now and we had this issue of (re)creating dev. environments when a new developer joins, or someone wishes to setup the project from scratch. There is considerable amount of time that's spent in just setting up the project, API keys, OAuth etc; The latest CLI does help with syncing the collections and functions but doesn't go beyond that.
We ended up creating our own CLI written on top of the Appwrite APIs to manage pretty much every resource Appwrite provides. But the most important feature being able to create a snapshot of the entire config and restoring/syncing it. This has helped us to reproduce the same env. on different machines very quickly - ~60s :)
For those of you interested in giving it a try check out
Pypi: https://pypi.org/project/appw/
Github: https://github.com/TheGallliNetwork/appwrite-cli
This snapshots are just json files that are created in the directory where you run the command. It tries not to store any of the API keys that get generated in your system, but uses placeholders and re-creates them on newer systems. The only key that gets stored in the snapshot (in plain text) are the auth keys (Oauth) - so please make sure you are aware of this and don't check-in to public repositories.
(sorry for the double posting)
bill-zhanxg commentedon Nov 24, 2023
I forked the repo and added support for relationship. I don't think the owner of that repo is still maintaining the project.
https://github.com/bill-zhanxg/appwrite-cloner
huy-lv commentedon Nov 24, 2023
I am reviewing your PR, please wait a sec 😄
byawitz commentedon Sep 16, 2024
As of the latest CLI release, you can clone a project with ease.
Check:
In a nutshell, you can do something so
You can also login using username+password+otp by running
eldadfux commentedon Oct 25, 2024
This is now possible to achieve in a few ways:
We will see if we can abstract this further with quick links from the console, but for now closing this issue.