Relocating an LLC or Corp

I know this was discussed before but I can’t seem to find the topic. Is it best to form the entity in the state you live in or the state you invest in?

Also, If I were to form an LLC or a Corp in say Nevada, then moved it to California. I know I would have to get a new business license and all that jazz. But does that effect how long the business has been around in regards to credit for the business? Or would the entity not move just add a business license for that state’s location?

Technically, you need to register in both.