Loading

×Sorry to interrupt
Uncaught ReferenceError: addCTracking is not defined
throws at https://kb.vmware.com/resource/KM_TealiumTrackingJS?v=0.5:100:1

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

How to backup and restore the Harbor tile in VMware PKS environment (67558)

Last Updated: 7/20/2022Categories: How toTotal Views: 9775Language:
English

Subscribe to get an email
newsletter with new updates

Please provide article feedback:

Purpose

This article contains information about how to backup and restore the Harbor in VMware PKS environment.

Cause

Harbor VM backup with traditional backup methods is not supported and there is no inbuilt feature Tile to take Backup.

Resolution

To backup the Harbor Tile:

Login to the Harbor tile VM using the Credentials available under Harbor tile > Credentials > harbor-app VM Credentials in the Ops Manager Dashboard.

Find a disk which has enough space, usually located in /var/vcap/store, create a backup directory named backup under it.

Run sudo -i to get to root mode privileges.

Download script 67558_harbor-backup.zip attached in this KB article, extract it to get the script 67558_harbor-backup.sh file nd copy it to /var/vcap/store/backup.

Note: Use Winscp for file transfer or create a new file using vi command and paste the content.

Issue the following command to make the /var/vcap/store/backup/67558_harbor-backup.sh  script executable:

chmod +x /var/vcap/store/backup/67558_harbor-backup.sh

Stop the Harbor service by running the command (This will also stop the wavefront containers if it is enabled. Remember to run monit start wavefront when you start harbor at the end of this article):

monit stop harbor

Ensure that there is no container is running, if there is, stop them.

alias docker='/var/vcap/packages/docker/bin/docker -H unix:///var/vcap/sys/run/docker/dockerd.sock'

docker ps -a

If there are leftover containers in docker ps -a preform the following steps (if not proceed with step 9):

docker stop $(docker ps -aq) && docker rm $(docker ps -aq)

Navigate to the backup directory and ensure that you have the script available here.

To Back up all the data (Images, Database), run the script by executing the below command:
./67558_harbor-backup.sh -–istile

Note: To backup only database data when harbor storage is NFS, GCP or S3, use –dbonly while running the script:
./67558_harbor-backup.sh --istile –dbonly

Once the backup is completed, you see a harbor.tgz file under /var/vcap/store with backup data.
ls  /var/vcap/store/backup

67558_harbor-backup.sh    harbor.tgz

You can start the Harbor service once the backup is completed. Also start wavefront if it is enabled on harbor.
monit start harbor 

monit start wavefront

To restore the Harbor Tile:

Install Harbor tile with the same configuration with the previous installation, such as the admin password, storage type configurations.

Login to the Harbor tile VM using the Credentials available under Harbor tile > Credentials > harbor-app VM Credentials in the Ops Manager Dashboard.

Run sudo -i to get to root mode privileges.

Find a disk which has enough space, usually located in /var/vcap/store, create a restore directory in it.

Download the script 67558_harbor-restore.zip attached in this KB article, extract it to get the script 67558_harbor-restore.sh and copy it to /var/vcap/store/restore.

Note: Use Winscp for file transfer or create a new file using vi command and paste the content.

Issue the following command to make the /var/vcap/store/backup/67558_harbor-restore.sh  script executable:

chmod +x /var/vcap/store/backup/67558_harbor-restore.sh

Stop the Harbor service by running the command (This will also stop the wavefront containers if it is enabled. Remember to run monit start wavefront when you start harbor at the end of this article):
monit stop harbor

Ensure that there is no container is running, if there is, stop it.
alias docker='/var/vcap/packages/docker/bin/docker -H unix:///var/vcap/sys/run/docker/dockerd.sock'

docker ps -a

If there are leftover containers in docker ps -a preform the following steps (if not proceed with step 10):

docker stop $(docker ps -aq) && docker rm $(docker ps -aq)

Navigate to the backup directory and ensure that you have the script & backup data available here.

To restore all the data (Images, Database), run the script by executing the below command:
./67558_harbor-restore.sh -–istile

Note: To only restore database data when harbor storage is NFS, GCP or S3, use –dbonly while running the script:
./67558_harbor-restore.sh --istile –dbonly

Start the Harbor service once the restoration is completed. Also start wavefront if it is enabled on harbor.
monit start harbor 

monit start wavefront

Verify all the Images and data present by logging into Harbor instance in the browser and browsing through the repositories under projects, and try pulling the images from K8S nodes.

Remove all unused data in /var/vcap/store/restore if it’s not required anymore.
rm -rf /var/vcap/store/restore

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
English

Attachments

67558_harbor-restore

67558_harbor-backup

67558_harbor-restore

67558_harbor-backup

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

KB
•
ESXi 中的网络接收流量故障或性能差 (50121760)

KB
•
Download and Install VMware Fusion (2014097)

Results 1-3 of 3

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware PKS

Related Versions:

VMware PKS 1.x

Take Our Survey

Support Assistant