There are several reasons for wanting to transfer an application to a new account, including:
- You just did the initial development of the application, and you want to pass off ownership of an application to another account for production use.
- Your organization had an employee develop an application on their individual account, and you want to move it to an org account.
- You are trying to consolidate multiple department accounts into a single organization account.
- You were transferred the ownership of an account, but need to modify or republish an application.
There is no automatic functionality to transfer entire application bundles between shinyapps.io accounts. This is a security measure to keep the content private for the original owner (for example, a GitHub token in the manifest). In order to transfer an application from one account to another, you will need the original account owner to download the current application bundle from their account (this allows them the control to remove any private content from the application before it is sent) and send it to you. You will then be able to rebuild the environment that that application was published under on your local machine using the package manifest and then republish the application to the new shinyapps.io account. I will lay out the steps for doing this below.
Obtain a copy of the original application code
If the project was developed and maintained well with version control software like Git, you could just pull the latest copy of the code from that project's repository. However, this doesn't guarantee the application will be in the exact same state as the originally published application. That is because the application depends both on the code used to create the application AND the packages (and package versions) used in the application bundle. If you want an exact copy of the published application, you will want a copy of the application bundle from the application's original account. This bundle contains both the code at the time of publishing and a copy of all the package dependencies and their versions.
You can download an application bundle from shinyapps.io by clicking on the Download button next to the Bundle label on the Application View page in the shinyapps.io dashboard.
Once downloaded, untar the file, and it should be a directory that looks similar to:
This should include all of your application code as well as manifest.json and a packrat directory. The manifest and packrat directory contains metadata for the shiny application as published. You will use these in the next step to recreate your published environment for the original application.
Recreate your publish environment
Next, take the folder that you downloaded and untared, or the folder that was sent to you by the original account owner, and open it as a project in an RStudio IDE.
In that RStudio project, make sure packrat is installed on your machine:
Now run packrat::restore() to create a project-level package library that matches the package versions from shinyapps.io, and then run packrat::on() to use that environment in your project.
Finally, restart your R session. It should now load from the packrat library instead of your default package library.
Publish to shinyapps.io
The last step is to publish your application to shinyapps.io. You can do this with either the deploy button in RStudio or using rsconnect::deployApp(). This is the same process as how you would publish any application to shinyapps.io.