Migrate existing Artifactory OSS installation to existing Artifactory PRO installation - artifactory

I tried setting up a remote-repo on my PRO installation to replicate from the OSS installation but I get an error.
Error testing pull replication config: Replication to remote
open-source Artifactory instance is not supported.
Is there a script that can use the CLI to download each OSS artifact and upload to the PRO installation?
Or, do I need to purchase a PRO license, export the OSS version, and import into a new PRO installation, just to be able to replicate from one instance to the other?

I think your best option is to follow these instructions from the JFrog wiki.
Note that if you've already installed your new Pro and started uploading Artifacts to it, you might need to run an Export on each repo, do a "clean upgrade" as per the link, and import the repos data back in. Do not do a full export on your pro, as the import will override the OSS data you upgraded.

I ended up downloading all the artifacts from the OSS artifactory (20GB) and wrote a simple script using jfrog cli to upload the files to the PRO artifactory. No down time, and didn't have to modify a working server just to be compatible for replication.

There is this (new) Wiki page that talks about updating OSS to Pro in place. I couldn't make it to work, the license would not apply properly, and the start-up kept failing. I also didn't exactly want to do an "in-place" update, and instead tried to run Pro version on a separate system against a copy of the OSS data.
The remaining method (barring manually re-importing all artifacts as #Branson did) is full import export. There doesn't seem to be clear instructions on how to do this (anymore), the "Upgrading Artifactory" wiki page doesn't anymore talk about migrating between installation types. It looks like there was a section for this there before, judging by the URL fragment in the OP's URL, but it's no longer there.
Having just completed this myself, this is the process that I followed. Note that in my case, the Pro version runs on another system.
Mount a sufficiently large drive to do a full system export
Prepare Pro instance - set up (temporary) admin password and enter the license key
On OSS instance - disable garbage collection and artifact clean up in Administration→Artifactory→Advanced→Maintenance. I did this by simply adding a next year in both cron expressions.
On OSS instance - disable the encryption as explained on this page (yes, this can only be done using an W/S API call). Failure to do so will likely land you on this problem, and you would have wasted your time.
On OSS instance - start the full system export ("Export System") in Administration→Artifactory→Import & Export→System. Check "Output Verbose Log" and have all other checkboxes unchecked.
If your database is of any decent size, the page will eventually show an "Oops" error. Ignore that, and keep monitoring the export process in the logs (artifactory-service.log).
Once the export is finished, detach the drive, and attach it to the Pro instance. Mount the file system
On Pro instance - start the full system import ("Import System") in Administration→Artifactory→Import & Export→System. Check "Output Verbose Log" and have all other checkboxes unchecked.
Again, the page will either timeout with "Oops" message, or show a login screen again. Ignore that, and monitor artifactory-service.log for the import process. Don't touch the UI until import completes. Once completed, your user database will be whatever it was in your OSS version. For me, the import took about 220% of the export time.

Related

RPM Remote Repository - Package does not match intended download

We're making use of a remote repository and are storing artifacts locally. However, we are running into a problem because of the fact the remote repository regularly rebuilds all artifacts that it hosts. In our current state, we update metadata (e.x. repodata/repomd.xml), but artifacts are not updated.
We have to continually clear our local remote-repository-cache out in order to allow it to download the rebuilt artifacts.
Is there any way we can configure artifactory to allow it to recache new artifacts as well as the new artifact metadata?
In our current state, the error we regularly run into is
https://artifactory/artifactory/remote-repo/some/path/package.rpm:
[Errno -1] Package does not match intended download.
Suggestion: run yum --enablerepo=artifactory-newrelic_infra-agent clean metadata
Unfortunately, there is no good answer to that. Artifacts under a version should be immutable; it's dependency management 101.
I'd put as much effort as possible to convince the team producing the artifacts to stop overriding versions. It's true that it might be sometimes cumbersome to change versions of dependencies in metadata, but there are ways around it (like resolving the latest patch during development, as supported in the semver spec), and in any way, that's not a good excuse.
If that's not possible, I'd look into enabling direct repository-to-client streaming (i.e. disabling artifact caching) to prevent the problem of stale artifacts.
Another solution might be cleaning up the cache using a user plugin or a script using JFrog CLI once you learn about newer artifacts being published in the remote repository.

Backup of Artifactory Instance - User not imported

Will appreciate if someone can please throw some light on best way to backup and restore Artifactory. Primary concern being the repository plus user and permission are available on restore.
I am trying System Export and import feature as well as incremental backup plus import but having no success with user/permissions when restore happens. Expecting to see ALL users after import from source - but net results are opposite - after restore completes only user I see is access-admin.
I even lose the user and anonymous on destination instance.
As per Arti. doc https://www.jfrog.com/confluence/display/RTF/Importing+and+Exporting ,system export and import should take care of ething including security BUT my tests does not seem to have user info on import.
From Doc. At system level, Artifactory can export and import the whole Artifactory server: configuration, security information, stored data and metadata. This is useful when manually running backups and for migrating and restoring a complete Artif. instance (as an alternative to using database level backup and restore).
artifactory.version=5.9.3
artifactory.timestamp=1521564024289
artifactory.revision=50903900
artifactory.buildNumber=820
Default embedded derby mode . In new instance not restoring the db as per my understanding documentation says - System Backup and Restore (ALL) will take care of all configurations.
But I am new to artifactory - Please correct me if my understanding is not correct.
Do like to point out restore is tried at seperately new spun instance with jfrog ami and not on the instance from where data was backed.
This is to test if we lose our instance completely , can we spin the new aws instance and quickly restore the artifactory envoirnment back.
Thanks in advance for help.

Artifactory: copy artifacts to new instance

I have an Artifactory instance running an old version of the community software(not pro) that is about to tear down. We experienced lots of index corruption and crashes recently and I'm very concerned about a fatal crash. There's is a lot of artifacts in it and some very precious ones for our business.
I wish to import artifacts from that old instance to a fresh install running the latest version.
I want to know:
what is the best path?
is the migration safe, could it trigger instability on the old Arti?
Is there a way to do a copy/sync will the old Artifactory remains usable?
is it possible to filter out artifacts that I don't want to copy?
You need to export the artifacts (and, probably, the configuration as well) from the old instance and import them into a new one.
If you have consistency issues, that might affect the export.
I would suggest backing up Artifactory (by creating system export), running consistency fix and reindexing and then export again, upgrade and import.
Good news - on the new version you never will have to reindex or run consistency fix :)

Changing Git protocol for RStudio project already under version control in Windows

I love using RStudio for it's built-in integration with version control systems. However with RStudio on Windows is there a way to change the Git protocol from http to ssh or vice versa for a project already under version control without first having to delete and recreate the project?
I might be missing something, but I originally cloned my repo using http which I subsequently found to be a massive pain because every time I want to push project changes to GitHub I have to re-enter my username and password. So I removed the project from version control(Project -> Project Option -> Git/SVN -> Version Control System: none) and then tried to re-add version control hoping to use ssh but it will only allow you to go back to the original protocol you selected when creating the project in the first place.
The only way I have found to change protocol it is to delete the project and then create a new project from GitHub using the correct ssh parameters. I'd really like to be able to change projects version control protocol from http to ssh without deleting and re-cloning first.
Is this possible?
Check out git config and the whole configuration stuff. You can configure several remotes to make the "distributed" aspect of git work.
You can try just copying the whole repository (or just .git/config, keep a copy!) and check what happens with your specific case when you change the configuration. It depends on lots of things that aren't under git's control, like firewall configurations en route, and the configuration on the other end.

How do I download my Appfog app's live file system?

Hello I am a Appfog beginner and I want to ask if I upload picture/plugins/themes via the wordpress admin. Because appfog does not currently support a persistent file system, all the plugins/pictes/themes not in the source code will be lost. Is there anyway to backup the current live system and include these files in the source code that I upload? The download source code button or the "af pull" command will only download the last source code I uploaded not changes that where made for example when I install a plugin.
You can add a helper php script to your app like this:
https://gist.github.com/4134750
You can manually download single files using af files <appname> /app/<filename> but this would be painfull for your purposes.
You would be much better served by setting up your Wordpress installation to run locally using Mamp or Xampp. Pull your app as it is from AppFog, host it locally using Mamp, making your file system changes, then pushing those changes to AppFog.
Here are a few reasons why making changes locally then updating AppFog apps is better:
If your running multiple instances of your wordpress app, only one of them will get the installed plugin. Installing the plugin locally and pushing insures all instances get the plugin.
Its much faster to develop and test locally and you can see the results of your changes before impacting your live site.
Your live production site will not go down if your plugin install fails or somehow makes an unintended change. This is also true for Wordpress updates, do them local then push to production.
If your have the changes on your local box you can use version control to track and tag releases before updating production.
blue-green deployments become trivial. Have two production apps, a primary and a slave app. Update your code locally then update the slave and test it then promote it to primary by mapping the domain to it. Then you demote the previous primary to slave by unmapping the domain. The slave is always one update older and you can switch back two it if you discover issue with your primary.
Curating your Wordpress apps this way will allow you to take advantage of power the AppFog platform provides.
I found this script "zipit" even better than the "ls" script Sea Comet provided. This will zip up the entire live app directory and then you download it. This way, you can make changes via the wordpress admin, get it all working the way you want it, then use zipit, unzip the file and push it to your app on appfog and the state is totally saved across restarts.
https://github.com/zeroecco/zipit/blob/master/zipit.php
You can find more info in this blog post over on the old PhpFog blog:
http://blog.phpfog.com/2012/11/16/how-to-download-your-entire-application-not-just-code-from-php-fog/

Resources