Unable to install app on new phone because "App is no longer available in the App Store"
If the app is 32-bit it will not work on iOS 11.

If it is 64-bit but not in the AppStore you can: 


Find an .ipa file of the app and sideload it with Cydia Impactor
Jailbreak both your iPhone 8 and 4. Then you can dump the .ipa file from your iPhone 4 (using something like iFunbox) and install it on your iPhone 8 (also using something like iFunbox or Cydia Impactor).


Note: Jailbreaking voids your warranty.