Wordpress Migration Errors Due File Size/Change Wordpress File Size Upload Limit

My YunoHost server

Hardware: old computer, bare metal. not vps
YunoHost version: 11.2.12
I have access to my server : Through SSH and through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? no
Wordpress: Installed version: 6.5~ynh1

Description of my issue

I am attempting to migrate Wordpress sites from a third party host to my yunohost box by using the “All-in-One WP Migration and Backup” by servmask. All-in-One WP Migration and Backup – WordPress plugin | WordPress.org

When trying to import my WP site into the blank yunohost Wordpress site, I get the following error message: Your file exceeds the maximum upload size for this site: 50 MB. How-to: Increase maximum upload file size:

  1. Edit .htaccess file

php_value upload_max_filesize 128M php_value post_max_size 128M php_value memory_limit 256M php_value max_execution_time 300 php_value max_input_time 300

OR

  1. Edit wp-config.php file

@ini_set( ‘upload_max_filesize’ , ‘128M’ ); @ini_set( ‘post_max_size’, ‘128M’); @ini_set( ‘memory_limit’, ‘256M’ ); @ini_set( ‘max_execution_time’, ‘300’ ); @ini_set( ‘max_input_time’, ‘300’ );

When choosing one of the above methods, I need to make the following changes:
upload_max_filesize – set this to a value > than your backup
post_max_size – set this to a value > than your backup
memory_limit – set this to a value > than your backup
max_execution_time – set this to 0 (infinite)

Since Yunohost is different than a standard Wordpress install, I do not know where those files are located within yunohost OS or whether they are the files I need to change. Can anyone help? Merci.

Solution: 2 steps

  1. Edit /etc/nginx/conf.d/YOURDOMAIN.tld.d/wordpress.conf

Steps:
a. make yourself root or sudo
b. cd to /etc/nginx/conf.d/YOURDOMAIN.tld.d/
c. backup original file: cp -a wordpress.conf wordpress.conf.backup
d. edit /etc/nginx/conf.d/YOURDOMAIN.tld.d/wordpress.conf via command: nano /etc/nginx/conf.d/YOURDOMAIN.tld.d/wordpress.conf
e. change the line client_max_body_size 30m to client_max_body_size INSERT VALUE. For example, client_max_body_size 5G
f. restart nginx with the following command: yunohost service reload nginx

  1. Edit /etc/php/INSERTPHPVERSIONNUMBER/fpm/pool.d/wordpress.conf

Steps
a. if not already done, make yourself root or sudo
b. cd to /etc/php/INSERTPHPVERSIONNUMBER/fpm/pool.d/ For example, /etc/php/8.2/fpm/pool.d/
c. backup original file: cp -a wordpress.conf wordpress.conf.backup
d. edit /etc/php/INSERTPHPVERSIONNUMBER/fpm/pool.d/wordpress.conf via command: nano /etc/php/INSERTPHPVERSIONNUMBER/fpm/pool.d/wordpress.conf
e. Change the following lines from

php_admin_value[upload_max_filesize] = 50M
php_admin_value[memory_limit] = 64M
php_admin_value[post_max_size] = 50M

To:

php_admin_value[upload_max_filesize] = INSERT VALUE (such as 1G, see below)
php_admin_value[memory_limit] = 1G
php_admin_value[post_max_size] = 1G

f. restart php with command: yunohost service restart phpVERSON-fpm For example, yunohost service restart php8.2-fpm

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.