Grounded in the Cloud
Showing results for 
Search instead for 
Do you mean 

Migrating your files with the Windows CLI

Stephen_Spector ‎05-09-2014 10:54 AM - edited ‎05-13-2014 07:34 AM

Not all of us have had the pleasure of using HP Cloud Object Storage yet. Some customers may keep their data on other storage systems like Amazon S3, Dropbox, or even Microsoft Skydrive. This can present a problem when migrating over to HP Cloud Object Storage. After all, we have better things to do with our time than copy our files one by one from system to the system. To address this problem we've created a new Powershell cmdlet available within the Windows CLI that I’d like to share with you called Migrate-drive. This cmdlet specializes in moving data from S3 Buckets , Skydrive and Dropbox to a set of our Object Storage Containers. First off, let’s look at a full S3 conversion in action. Suppose that we had TLPRoot and TLPTest2 Buckets in S3 and the TLPTest2 Bucket contained MikeConfig.txt and NewHelp.text files.

Now let’s move these files over to HP Cloud Object Storage.



Your first argument is the Provider name. Valid entries are S3, Skydrive and Dropbox. The –ak stands for AccessKey and –sk stands for Secret Key. These parameters are only required if S3 is the Provider (more on this later). Now let’s check our results.



In the example above we’ve copied every S3 Bucket found for the supplied credentials into a set of corresponding Containers. After we issue the get-psdrive command you can see that a new set of Containers exist, one for each migrated Bucket. To mount just issue


Cd yourContainer:


You should also notice that any folder structures that you’ve created within S3 have been preserved during the copy operation. Now let’s introduce a bit more precision by moving only the Buckets that we’re interested in. In this case the TLPRoot bucket.



The –b argument takes a set of comma delimited bucket names (each in quotes) and copies only those specified over to Object Storage.


Finally let’s look at a few other providers that we can move data from. Here’s an example of moving our SkyDrive based data.



In this example you’ll notice that the only required parameter is the Provider name. The reason no credentials are required for non-S3 stores is because these operations rely on the fact that you’ve installed the Skydrive or Dropbox clients. These clients keep your local machine in sync with the store and we’re simply doing a complete recursive copy from your local machine, to HP Cloud Object Storage. One side effect of this approach is the need to place the folders found in a root container named after the Provider. You can see this by observing the SkyDrive Container present in the get-psdrive output above.


We hope this cmdlet simplifies migrating or backing up your files from other storage providers. If you have ideas or questions please feel free to send feedback to the Developer Experience team.  We look forward to hearing from you.

About the Author


Stephen Spector is a HPE Cloud Evangelist promoting the OpenStack based clouds at HPE for hybrid, public, and private clouds . He was previously at Dell promoting their Cloud solutions and was the open source community manager for OpenStack and at Rackspace and Citrix Systems. While at Citrix Systems, he founded the Citrix Developer Network, developed global alliance and licensing programs, and even once added audio to the DOS ICA client with assembler. Follow Stephen at @SpectorID

Leave a Comment

We encourage you to share your comments on this post. Comments are moderated and will be reviewed
and posted as promptly as possible during regular business hours

To ensure your comment is published, be sure to follow the Community Guidelines.

Be sure to enter a unique name. You can't reuse a name that's already in use.
Be sure to enter a unique email address. You can't reuse an email address that's already in use.
Type the characters you see in the picture above.Type the words you hear.
1-3 December 2015
Discover 2015 London
Discover 2015 in London, the ultimate showcase technology event for business and IT professionals to learn, connect, and grow.
Read more
November 2015
Software Online Expert Days
Join us online to talk directly with our Software experts.
Read more
View all