cancel
Showing results for 
Search instead for 
Did you mean: 

Can I move "Media" directory to other partition?

Can I move "Media" directory to other partition?

Hello.

By default, the "Media" directory  is on my "sda", but I want to add another HDD and move "Media" directory to it. Which line of configuration must be change?

 

Thank you.

7 REPLIES 7

Re: Can I move "Media" directory to other partition?

Hello,

You need change media url and make sure it will accessible by url

Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Can I move "Media" directory to other partition?

Accessible by url? What does it mean?

Re: Can I move "Media" directory to other partition?

Accessible by URL? What does it mean?

Re: Can I move "Media" directory to other partition?

Hello @jason_long 

 

let's example your site url is : test.com

and you set media url to : test2.com

 

you need to upload all files into test2.com 

 

hope it will help you.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Can I move "Media" directory to other partition?

Easiest thing to do is move the media directory to your other partition, then symlink media in your Magento root directory to the new location.

 

For example, if your Magento root in in:

/home/xxx/public_html

 

and your new media directory is:

/home2/xxx/media

 

ln -s /home2/xxx/media /home/xxx/public_html/media

 

Re: Can I move "Media" directory to other partition?

Is "public_html" mandatory? The CentOS Apache directory is "/var/www/html" .

Re: Can I move "Media" directory to other partition?

No, public_html was just an example. In your case:

ln -s /path/to/other/partition/media /var/www/html/media