Skip to content

[PRODUCTIVITY] "Copy / Clone" Projects, collections, documents #366

Closed

Description

@thyybrandao

Add an action button to clone / copy the project, collection or document. In the case of similar projects it would make everything more productive.

Activity

  1. eldadfux commented on May 30, 2020

    @eldadfux
    Member

    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.

  2. added
    discussion
    enhancement
    on May 30, 2020
  3. self-assigned this
    on May 30, 2020
  4. punitdiwan commented on May 31, 2020

    @punitdiwan

    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.

  5. Meldiron commented on Jul 14, 2021

    @Meldiron
    Contributor

    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?".

  6. AhmedHammad0900 commented on Nov 6, 2021

    @AhmedHammad0900

    is this feature available now ?

  7. kiloki-official commented on Jan 13, 2022

    @kiloki-official

    Cloning collections and projects would be VERY useful!!!

  8. gewenyu99 commented on May 20, 2022

    @gewenyu99
    Contributor

    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

  9. stnguyen90 commented on Jul 14, 2022

    @stnguyen90
    Contributor

    Possibly related issue: #491

  10. bliyscom commented on Sep 8, 2022

    @bliyscom

    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

  11. stnguyen90 commented on Oct 21, 2022

    @stnguyen90
    Contributor

    @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?

  12. huy-lv commented on Jul 6, 2023

    @huy-lv

    Hey, I have built an open source tool to clone database, users, teams. Hope this help you.
    https://github.com/huy-lv/appwrite-cloner

    image
  13. bliyscom commented on Jul 6, 2023

    @bliyscom
  14. gewenyu99 commented on Jul 6, 2023

    @gewenyu99
    Contributor

    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.

  15. bhagn commented on Aug 6, 2023

    @bhagn

    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)

  16. bill-zhanxg commented on Nov 24, 2023

    @bill-zhanxg

    Hey, I have built an open source tool to clone database, users, teams. Hope this help you.

    https://github.com/huy-lv/appwrite-cloner
    image

    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

  17. huy-lv commented on Nov 24, 2023

    @huy-lv

    I am reviewing your PR, please wait a sec 😄

  18. byawitz commented on Sep 16, 2024

    @byawitz
    Contributor

    As of the latest CLI release, you can clone a project with ease.
    Check:

    In a nutshell, you can do something so

    # 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
  19. eldadfux commented on Oct 25, 2024

    @eldadfux
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions