migrating from Apple ID to another one keeping data


I have iPad with Apple ID A and iPhone with another one B, I want to configure iPad with Apple ID B leaving A!
My target is to have the same account B on both devices.
In iPad when I log out Apple ID (A) what happens ? My photos and files are kept into device ?
If I login Apple ID B data inside iPad are merged to Data of account A ?