• Hello,

    I have linux vps.

    On the 1st, wordpress is hosted. the second I want to use as a storage for media library.

    So when I upload a file through wordpress on the 1st VPS, I want the file to be uploaded on the second VPS.

    Im aware its possible to do it with mounting the second vps…

    But is there a more simple solution, for example through FTP logins alone?
    If so, how can I do it? any code for me to paste somewhere?

    • This topic was modified 2 years, 11 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 5 replies - 1 through 5 (of 5 total)
  • This is not possible with WordPress’s own resources. For this you would need a plugin, which copies after upload of each file this on what-for-a-way-ever to the 2nd server. I don’t know of any plugin that allows this, to me it sounds more like a very individual solution that you could certainly solve with an individual plugin.

    Im aware its possible to do it with mounting the second vps…

    But is there a more simple solution, for example through FTP logins alone?
    If so, how can I do it? any code for me to paste somewhere?

    You may be imagining this to be more involved than it really is.

    Here’s a handy guide… using SSH Filesystem (SSHFS) to mount remote directories:

    https://www.linode.com/docs/guides/using-sshfs-on-linux/

    Thread Starter blissout

    (@blissout)

    @gappiah

    Do I just need to mount it?
    I dont need to do anything in wordpress itself on the first vps?
    and lets say I want to use the storage of the first vps again, do I unmount it and everything will return to normal?

    Let’s say your WordPress site runs on SERVER-A, and you want to use SERVER-B as a remote storage server.

    1) Working from SERVER-A, you’ll mount a directory on SERVER-B to a directory in SERVER-A.

    2) Then you’ll tweak your WordPress configuration, to use the newly-mounted remote directory as your custom UPLOADS folder.

    If this were a fresh install, then you could mount the remote directory (SERVER-B) to WordPress’ default uploads directory in SERVER-A (wp-content/uploads)… so you’d skip step two above.

    … and lets say I want to use the storage of the first vps again, do I unmount it and everything will return to normal?

    From WordPress’ perspective, all you’d have to do is remove the custom uploads directory configured in step 2 above, to revert to the default uploads directory (wp-content/uploads). Of course, you’d lose any files you stored on the second server.

    If you’re not very comfortable with the Linux shell, then I’ll highly recommend you look at other options:

    1) Get a single server with more storage capacity.

    2) Check if your host has block storage that you can easily mount inside your WordPress server, negating the need to manage a second server.

    3) Offload your media to a cloud storage provider. There are several plugins available to make this a simple click-click-done process.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remote media library storage server’ is closed to new replies.