1. Stop the SQL server services on the primary server.
2. Run a full backup the primary server right before the maintenance.
3. Restore the database files on the disconnected secondary server and point the web.config files to the secondary server. This should get the website back up and running with minimal downtime.
4. Uninstall SQL, install more RAM and reinstall SQL x64 on the primary server
5. Recreate the database mirroring with the secondary as the primary.
6. Failover the mirroring to make the primary and secondary roles as they were before the upgrade.