@@ -0,0 +1,1040 @@
+from __future__ import absolute_import, print_function, unicode_literals%0A%0Afrom django.core.management import BaseCommand%0A%0Afrom corehq.apps.app_manager.dbaccessors import get_build_doc_by_version, wrap_app%0Afrom corehq.apps.app_manager.models import import_app%0A%0A%0Aclass Command(BaseCommand):%0A    help = %22Make a copy of a specific version of an application on the same domain%22%0A%0A    def add_arguments(self, parser):%0A        parser.add_argument('domain')%0A        parser.add_argument('app_id')%0A        parser.add_argument('version')%0A        parser.add_argument('new_name')%0A%0A    def handle(self, domain, app_id, version, new_name, **options):%0A        old_app = get_build_doc_by_version(domain, app_id, version)%0A        if not old_app:%0A            raise Exception(%22No app found with id '%7B%7D' and version '%7B%7D', on '%7B%7D'%22%0A                            .format(app_id, version, domain))%0A        old_app = wrap_app(old_app)%0A        old_app.convert_build_to_app()%0A        new_app = import_app(old_app.to_json(), domain, source_properties=%7B'name': new_name%7D)%0A

Add basic "copy_app" mgmt cmd