How can I move application data from system disk to attached disk

0

Hi - this is probably something very simple, however we could not figure it out ourselves.

We started using Lightsail 3 months back, installed Plesk and setup a few websites, some using Wordpress. Looks pretty simple to manage so far.

Now when I read about backups, I see the advise that it is better to keep application data on attached disks instead of system disk.

I see clear instructions on how to create an new disk and attach it to my instance. However, how do I move all the websites that exist on my system disk to the new attached disk?

Thanks.

RSCago
질문됨 5년 전464회 조회
8개 답변
0

It depends on the operating system you are using but generally fairly technical.

If you are using Linux, you will need to do the following...

  1. Create the external storage.
  2. Create a file system on the storage using the mkfs command (lots of file system options to consider).
  3. Mount the file file system in a temporary location use the mount command (also lots of options to consider).
  4. Copy (or move, if you're feeling lucky) the data to the file system temporary location.
  5. Move the data you just copied to a backup location (unless you're feeling lucky ... I never am, so I always backup).
  6. Unmount the file system from the temporary location.
  7. Choose a permanent location for the file system.
  8. Update the fstab file to automatically mount the file system at its permanent location (again, lots of options to consider).
  9. Run the 'mount -a' command to mount the file system to its permanent location (also verifies your fstab modifications work).
  10. Test your application to make sure it works the way you expect it to.
  11. Retest your application to make sure it works the way you expect it to (I'm a software developer, I never trust a single test).

All this said, is there a clear requirement to move the files? For backup purposes, you can use snapshots. This backs up your entire system (attached storage included) so you can restore to a point in time. There are other posts about how to automate this process using lambda.

david

profile picture
David G
답변함 5년 전
0

Thanks for the guidance.

We are running Plesk on top of Linux (Plesk_Hosting_Stack_on_Ubuntu).

I wish there was an easier more straightforward way to do it. We have to first figure out where exactly are all the current files under Plesk stored? And then follow the steps you mentioned below to do the move.

The reason why we are contemplating this move is what we read at this post:

https://awsinsider.net/articles/2017/11/17/aws-lightsail-block-storage.aspx

"Attached disks are useful for applications or software that need to separate out specific data from their core service and to protect application data in case of a failure or other issue with your instance and system disk,"

"The system disk included with your Lightsail plan is your instance's root device. If you terminate your instance, the system disk will be deleted as well. If you experience an instance failure, the system disk could be impacted. You also cannot detach your system disk or back it up separately from your instance," AWS said. "Data stored on an attached disk persists independently of the instance. Attached disks can be detached and moved between instances and can be backed up independently from an instance using disk snapshot."

RSCago
답변함 5년 전
0

What you're trying to do is not very common, nor easy or straightforward, so it makes sense that the solution isn't either. I would also expect attached storage to be somewhat slower than your system disk, so keep that in mind. I don't think what you're looking to do here is worth the hassle and increased complexity, to be honest, especially if you don't have the technical knowledge to maintain it or solve problems when they arise.

What I would take from the quotes you posted is not to move everything over to attached storage, but instead: (1) don't terminate your instance (should be obvious), and (2) make sure you always have good back-ups in case of a system failure. Both points are not specific to Lightsail, of course, data loss can occur anywhere.

RobMM
답변함 5년 전
0

RobMM wrote:
I would also expect attached storage to be somewhat slower than your system disk

I'm not sure this is true. Storage is storage. Lightsail storage is all SSD based, so added storage should be as fast as system storage. As I think more about it, system storage might be slightly slower than added storage ... because the OS is accessing the system storage itself, taking IO activity away from the application. An application on added storage wouldn't be used for system activity. The difference, however, would be negligible and imperceptible.

make sure you always have good back-ups in case of a system failure.
Both points are not specific to Lightsail, of course, data loss can occur anywhere.

Always good advice.

david

profile picture
David G
답변함 5년 전
0

You're right, there doesn't really seem to be a different between the storage types. I figured maybe there would be additional latency for attached block storage, assuming block storage is hosted further away from the VM than the system disk, but I tested it just now and that doesn't appear to be the case; performance is pretty much identical.

RobMM
답변함 5년 전
0

Just curious ... how did you benchmark the performance?

david

profile picture
David G
답변함 5년 전
0

I just ran some quick tests with dd, hdparm and ioping.

RobMM
답변함 5년 전
0

profile picture
David G
답변함 5년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠