Even if I change the 'upload_max_filesize' in /etc/php/8.2/apache2/php.ini the upload file size is not changing. Any idea what could me wrong
Some questions those responding here need to ask of the OP ...
Criteria for the OP's 'migration' (see other thread by OP on migration):
1. Same FQDN.
2. Almost 0 down time.
3. No loss of data.
Note: the 'consultant' involved has said that a site migration is 'too risky'.
Your current servers have 4.1's of moodle. Those versions cannot run under php 8.2. So this must be about a new server. Can't have 2 stand alone servers on the internet by the same FQDN ... so criteria 1 hasn't been met.
Questions ... for thought/planning ...
What have you done on new server to prep for taking on course backups?
The server from which this backup came, did it use an authentication other than manual for the course you are attempting to restore? How about other 3rd party plugins? Same theme?
The file you are trying to upload, is it an .mbz file - course backup from current server?
How large is the .mbz file?
How many courses will you have to restore? ... negates criteria 2 above.
If you do get this course backup restored, if the users in the course have been informed of a new location and login, will they find something missing? Restore of a course with all user data up to date is only as good as how long it took to restore the course .... and if you didn't shut off access to this course on current server and users did anything in the current location of the course, that activity will not be in the course that you restored. Thus criteria 3 (no loss of data) is questionable.
All in all, none of the criteria will be met - 100% - ... so will teachers/participants/your boss be 'happy'?
My first and last '2 cents' in this thread!
'SoS', Ken
Ok, I lied ... one more response ... @Howard ... yeah, that's the one.
The path and file /etc/php/8.2/apache2/php.ini is an indication OP's server has a Plesk/cPanel interface into the config of PHP per domain. Normally, at the top of the config file there is a warning about manually editing - which should be heeded.
On such VPS systems, /var/www/ (the typical home directory for apache) isn't accessible via the GUI ... only via command line. Instead, the user account is made part of sudo groups and the document roots are in /home/[userlogin]/public_html or public.
As evidenced by OP's other posting and the obsecured group name and comment about 'slightly different structure'.
For such systems, there might be a /home/[userlogin]/public/domainname directory. In OP's case there will probably be multiple domainname directories.
On old system ... there were 3 instances of moodle by different FQDN's.
Am gathering that OP is attempting what the 'other consultant' advised ... make course backups from the 4.1 systems and restore them to newly installed moodle instances on new server - which is a valid route, if one doesn't have thousands of courses.
Of course, if that becomes the standard proceedure for this OP, in a few years time, the version of moodle installed will become obsolete and OP will take the same approach ... which means another server - more hassle, etc. Oh, well!
'SoS', Ken
Also, important to restart php8.2-fpm (or apache2) depending on where you changed it (as Emma suggested).

Loaded Configuration File '/etc/php/8.2/apache2/php.ini'

sudo nano /etc/php/8.2/apache2/conf.d/99-custom-settings.ini
Added the following lines:
upload_max_filesize = 1000M
post_max_size = 1000M
sudo systemctl restart apache2
Created a info.php in sudo nano /var/www/html/info.php now if go to http://192.168.18.151/info.php is showing
upload_max_filesize 1000M
